The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Undeclared OpenGL functions xcode iphone template
polyfrag


Joined: 24 May 2014
Posts: 30
I'm using the iPhone template with my own code. All the OpenGL includes are in platform.h:

Code:

#include "SDL.h"
#include "SDL_opengl.h"
#include "SDL_net.h"
#include "SDL_mixer.h"


Even when I directly include SDL_opengl.h in the source file, it tells me glUniform4f or something else is undeclared. I linked it with OpenGLES.framework too. I select the function name and click Jump to Definition and it shows it as being defined in SDL_gles2funcs.h and ES2/gl.h. What's needed to get it working with OpenGL ES?
Undeclared OpenGL functions xcode iphone template
Alex Szpakowski
Guest

SDL_opengl.h is for desktop OpenGL. Since you’re using iOS (and OpenGL ES 2, presumably) you’ll want to #include “SDL_opengles2.h” instead of SDL_opengl.h.

On Jan 9, 2015, at 7:42 PM, polyfrag wrote:
Quote:
I'm using the iPhone template with my own code. All the OpenGL includes are in platform.h:

Code:
#include "SDL.h"
#include "SDL_opengl.h"
#include "SDL_net.h"
#include "SDL_mixer.h"



Even when I directly include SDL_opengl.h in the source file, it tells me glUniform4f or something else is undeclared. I linked it with OpenGLES.framework too. I select the function name and click Jump to Definition and it shows it as being defined in SDL_gles2funcs.h and ES2/gl.h. What's needed to get it working with OpenGL ES?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
polyfrag


Joined: 24 May 2014
Posts: 30
Thank you!