Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <stdio.h>
- #include <SDL.h>
- #include <SDL_opengl.h>
- int main(void)
- {
- if(SDL_Init(SDL_INIT_VIDEO) == -1)
- {
- printf("SDL_Init() failed\n");
- SDL_Quit();
- exit(1);
- }
- SDL_Window *gl_window = SDL_CreateWindow("Test Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 200, 100, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
- if (gl_window == NULL)
- {
- printf("SDL_CreateWindow() failed\n");
- SDL_Quit();
- exit(1);
- }
- SDL_GLContext gl_context = SDL_GL_CreateContext(gl_window);
- if (gl_context == NULL)
- {
- printf("SDL_CreateWindow() failed\n");
- SDL_Quit();
- exit(1);
- }
- const char* my_string = (const char*) glGetString (GL_VENDOR);
- if (my_string == NULL)
- {
- printf("glGetString() failed\n");
- SDL_Quit();
- exit(1);
- }
- printf("Got string [%s]\n", my_string);
- printf("Sleeping....\n");
- sleep(5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement