Skip to main content

Problem with SLDSDL/OpenGL

I've started to do sth.something with SDL/openGLOpenGL, but I haven't managed to get this tutorial running yet: (http://www.sdltutorials.com/sdl-opengl-tutorial-basics).

Since this tutorial, or most tutorials at all, are written in SDL 1.2, I changed just this part of the tutorial's code:

instead of:

if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to:

SDL_Window *window;
if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED,
                              SDL_WINDOWPOS_UNDEFINED,
                              640, 480,
                              SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correctlycorrect, except the last one,: this is "SDL_GL_SwapBuffers()";

SDL_GL_SwapBuffers();. Xcode says: use of undeclared identifier....

I think it's deprecated in SDL 2.0, but I couldn't find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?

Problem with SLD/OpenGL

I've started to do sth. with SDL/openGL, but I haven't managed to get this tutorial running yet (http://www.sdltutorials.com/sdl-opengl-tutorial-basics).

Since this tutorial, or most tutorials at all, are written in SDL 1.2, I changed just this part of the tutorial's code:

instead of:

if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to:

SDL_Window *window;
if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED,
                              SDL_WINDOWPOS_UNDEFINED,
                              640, 480,
                              SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correctly except the last one, this is "SDL_GL_SwapBuffers()";

Xcode says: use of undeclared identifier....

I think it's deprecated in SDL 2.0, but I couldn't find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?

Problem with SDL/OpenGL

I've started to do something with SDL/OpenGL, but I haven't managed to get this tutorial running yet: http://www.sdltutorials.com/sdl-opengl-tutorial-basics.

Since this tutorial, or most tutorials at all, are written in SDL 1.2, I changed just this part of the tutorial's code:

instead of:

if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to:

SDL_Window *window;
if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED,
                              SDL_WINDOWPOS_UNDEFINED,
                              640, 480,
                              SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correct, except the last one: this is SDL_GL_SwapBuffers();. Xcode says: use of undeclared identifier...

I think it's deprecated in SDL 2.0, but I couldn't find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?

added 16 characters in body
Source Link
ratchet freak
  • 8.1k
  • 20
  • 16

I've started to do sth. with SDL/openGL, but iI haven't achievedmanaged to get run this tutorial running yet (http://www.sdltutorials.com/sdl-opengl-tutorial-basics).

Since this tutorial, or most tutorials at all,are are written in SDL 1.2, iI changed just this part of the tutorial's code:

instead of: if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to: SDL_Window *window; if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

SDL_Window *window;
if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED,
                              SDL_WINDOWPOS_UNDEFINED,
                              640, 480,
                              SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correctly except the last one, this is "SDL_GL_SwapBuffers()";

Xcode says: use of undeclared identifier....

iI think it's deprecated in SDL 2.0, but i could'ntI couldn't find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?

I've started to do sth. with SDL/openGL, but i haven't achieved to get run this tutorial yet (http://www.sdltutorials.com/sdl-opengl-tutorial-basics).

Since this tutorial, or most tutorials at all,are written in SDL 1.2, i changed just this part of the tutorial's code:

instead of: if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to: SDL_Window *window; if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correctly except the last one, this is "SDL_GL_SwapBuffers()";

Xcode says: use of undeclared identifier....

i think it's deprecated in SDL 2.0, but i could'nt find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?

I've started to do sth. with SDL/openGL, but I haven't managed to get this tutorial running yet (http://www.sdltutorials.com/sdl-opengl-tutorial-basics).

Since this tutorial, or most tutorials at all, are written in SDL 1.2, I changed just this part of the tutorial's code:

instead of:

if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to:

SDL_Window *window;
if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED,
                              SDL_WINDOWPOS_UNDEFINED,
                              640, 480,
                              SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correctly except the last one, this is "SDL_GL_SwapBuffers()";

Xcode says: use of undeclared identifier....

I think it's deprecated in SDL 2.0, but I couldn't find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?

Source Link
reynmar
  • 449
  • 5
  • 7

Problem with SLD/OpenGL

I've started to do sth. with SDL/openGL, but i haven't achieved to get run this tutorial yet (http://www.sdltutorials.com/sdl-opengl-tutorial-basics).

Since this tutorial, or most tutorials at all,are written in SDL 1.2, i changed just this part of the tutorial's code:

instead of: if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) == NULL)

to: SDL_Window *window; if((window = SDL_CreateWindow("SDLWindow", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_GL_DOUBLEBUFFER | SDL_WINDOW_OPENGL)) == NULL)

Now, all parts of the code seem to be correctly except the last one, this is "SDL_GL_SwapBuffers()";

Xcode says: use of undeclared identifier....

i think it's deprecated in SDL 2.0, but i could'nt find the right function in the migration guide, or is the problem something else?

Can anyone help me with that?