Quantcast
Channel: Forum Pasja Informatyki - Najnowsze pytania bez odpowiedzi
Viewing all articles
Browse latest Browse all 21942

Nie wyświetla się żadne okienko podczas kompilacji (SDL2) na XCode 8.

$
0
0
Witam, posiadam macbooka i muszę zrobić grę na zaliczenie. W tym wypadku potrzebuję biblioteki graficznej, zdecydowałem się na SDL2( nad allegro 5 nie myślałem). SDL2 zainstalowałem według wieeelu poradników znalezionych w internecie, ale problem jest w tym, że gdy kompiluję kod(pomyślnie, wyskakują mi tylko 3 warningi), to nie wyświetla mi się żadne okienko na pulpicie (jedynie w Docku pokazuje się ten plik ale nie mogę go otworzyć, nic z nim zrobić, po czasie znika. Szukam odpowiedzi od 2 dni i nie mogę nic z tym zrobić :/ Z góry dziękuję za każdą możliwą pomoc, jest to dla mnie bardzo ważne.

 

Tak wygląda kod:

#include "SDL2/SDL.h"

#include <stdio.h>

#include <SDL2/SDL_assert.h>

#include <SDL2/SDL_hints.h>

 

int main(int argc, char* argv[]) {

    

    SDL_Window *window;                    // Declare a pointer

    

    SDL_Init(SDL_INIT_VIDEO);              // Initialize SDL2

    

    // Create an application window with the following settings:

    window = SDL_CreateWindow(

                              "An SDL2 window",                  // window title

                              SDL_WINDOWPOS_UNDEFINED,           // initial x position

                              SDL_WINDOWPOS_UNDEFINED,           // initial y position

                              640,                               // width, in pixels

                              480,                               // height, in pixels

                              SDL_WINDOW_OPENGL                  // flags - see below

                              );

    

    // Check that the window was successfully created

    if (window == NULL) {

        // In the case that the window could not be made...

        printf("Could not create window: %s\n", SDL_GetError());

        return 1;

    }

    

    // The window is open: could enter program loop here (see SDL_PollEvent())

    

    SDL_Delay(3000);  // Pause execution for 3000 milliseconds, for example

    

    // Close and destroy the window

    SDL_DestroyWindow(window);

    

    // Clean up

    SDL_Quit();

    return 0;

}

 

Warningi:

1. Dependency Analysis Warning

Warning: skipping file '/Library/Frameworks/SDL2.framework/Versions/A/Headers/(unexpected...

2. Documentation Issue

- '-return' command used in a comment that is attached to a function returning void SDL_assert.h

- Parameter 'callback' not found in the funkction declaration SDL_hints.h

Viewing all articles
Browse latest Browse all 21942

Trending Articles


TRX Antek AVT - 2310 ver 2,0


Автовишка HAULOTTE HA 16 SPX


POTANIACZ


Zrób Sam - rocznik 1985 [PDF] [PL]


Maxgear opinie


BMW E61 2.5d błąd 43E2 - klapa gasząca a DPF


Eveline ➤ Matowe pomadki Velvet Matt Lipstick 500, 506, 5007


Auta / Cars (2006) PLDUB.BRRip.480p.XviD.AC3-LTN / DUBBING PL


Peugeot 508 problem z elektroniką


AŚ Jelenia Góra