[SDL] Triangle will not render

Jonas Kulla nyocurio at gmail.com
Tue Sep 16 20:24:39 PDT 2014

A couple things:

Don't use glFrustum, that's GL1 stuff for modifying the current matrix.
Implicit matrices have been deprecated in OpenGL (the entire
Push/Pop/IdentityMatrix shebang). If you need matrices, pass them directly
as uniforms into your shaders. (But for a simple triangle, whose vertices
you have already defined in screen space anyway, you don't).
In the render loop, you're disabling the vertex attrib array but never
enabling it again thereafter. Might want to look into that.
Finally, you didn't post your shader sources, so it's impossible to know if
something is wrong there. I can't even tell what color it's outputting.


2014-09-17 3:29 GMT+02:00 Justin Agrell <justin at u4e.us>:

> I'm getting started with SDL2 and modern OpenGL.
> I am having trouble getting the triangle to render in my template:
> source code here: http://u4e.us/c/main.c
> This may be due to my laptop only supporting OpenGL 3.1.
> > glxinfo |grep "Core Profile"
> OpenGL core profile version string: 3.1 (Core Profile) Mesa 9.1.8
> It also may be because I have been staring at it for too long and am
> missing something simple.
> Any help would be appreciated.
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20140917/7e568730/attachment-0001.htm>

More information about the SDL mailing list