[SDL] Help with SDL 1.3 and OpenGL 3.3/GLSL3.3core
Alex Barry
alex.barry at gmail.com
Fri Nov 18 19:14:07 PST 2011
Hi, me again,
So, now I've debugged the crap out of my OpenGL code, and rooted out all
the errors, but I still have the misfortune of having nothing rendered to
my screen.
Any help reviewing my code would be greatly appreciated. If this is out of
scope for the SDL mailing list, I understand, and I'll repost in a more
appropriate forum.
Thanks ladies and gents,
-Alex
On Fri, Nov 18, 2011 at 12:50 PM, Alex Barry <alex.barry at gmail.com> wrote:
> So, the shader issue was glew's experimental option gone wrong, so I
> stopped using that, (the call was glewExperimental = GL_TRUE; in
> sdlapp.cpp:51, for those interested). I was still getting rendering
> issues, but it turns out the issue is that I need a bound VAO (vertex array
> object), so I got that, and I think I have it sorted out.
>
> Thanks for the help, Forest,
> -Alex
>
>
> On Thu, Nov 17, 2011 at 6:22 PM, Alex Barry <alex.barry at gmail.com> wrote:
>
>> So, i just put in a crap load of glGetError checks, and here is the
>> problem (glshader.cpp:77-78):
>>
>> this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
>> undeadland::logEnterFromGlError( glGetError(),
>> "(glshader.cpp:77->glCreateShader)" );
>>
>> I get an error about the enumeration value, GL_VERTEX_SHADER, which is
>> the correct value, according to
>> http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml
>>
>> Did I miss something to be able to use GL_VERTEX_SHADER?
>>
>> Any help would be appreciated,
>> -Alex
>>
>> On Thu, Nov 17, 2011 at 3:17 PM, Forest Hale <havoc at ghdigital.com> wrote:
>>
>>> I briefly glanced at the code and don't notice anything out of the
>>> ordinary at a glance, but why are you not checking glGetError() after each
>>> gl call? It is often the first step in debugging OpenGL problems.
>>>
>>> If you were not targeting GL3.3core I would suggest doing some simpler
>>> debugging tests with glBegin and such.
>>>
>>> In any case these are the usual suspects:
>>> glClear - make sure your glDepthMask and glColorMask and glStencilMask
>>> and such are TRUE before you clear the corresponding buffer bit or it won't
>>> work.
>>> glScissor - make sure your glScissor includes the area you wish to
>>> render into, if GL_SCISSOR_TEST is enabled at least.
>>> glUniformMatrix - make sure your matrix is good, and not transposed.
>>> glColorMask/glDepthMask/**glStencilMask - make sure you have the write
>>> masks enabled that you think you do :)
>>>
>>> When in doubt I often fall back to reproducing the same intended result
>>> by other means, like doing a screen coordinate transform in software
>>> (equivalent to gluProject stuff) to make sure I have everything right
>>> (checking if the pixel coords are in bounds, etc).
>>>
>>>
>>> On 11/17/2011 08:41 AM, Alex Barry wrote:
>>>
>>>> Hi,
>>>> I don't know if this is the right place to post this, as it's not
>>>> necessarily an SDL issue, but I'm stuck trying to render a land-mesh, which
>>>> for some reason just won't render.
>>>> I have the project on github, and it can be found here:
>>>> https://github.com/mrozbarry/**procworld<https://github.com/mrozbarry/procworld>(if you see any code you like, you can steal it - I currently don't have a
>>>> license for this source, so
>>>> while the getting is good... :P)
>>>>
>>>> So, I was originally doing a huge triangle mesh to try and render that,
>>>> and I got frustrated with it, so I re-coded it into a point cloud, just to
>>>> get the rendering done, and it still doesn't work.
>>>> The opengl/sdl code is spread between a few different files:
>>>>
>>>> * sdlapp.* has most of the SDL centric code in it - I don't think
>>>> the issue is here, but maybe I'm wrong...
>>>> * glshader.* has the shader loading/validation routines, which also
>>>> seems to work fine
>>>> * landscape.* generates the landscape, and has the rendering routine
>>>> in it
>>>> * camera.* has most of the matrix transforms in it
>>>>
>>>>
>>>> I've been banging my head over this for a few days, and can't get
>>>> anything to render at all. What's more frustrating is that I am helping
>>>> convert some of the tutorials from
>>>> http://www.opengl-tutorials.**org/ <http://www.opengl-tutorials.org/>, and I'm using a similar sdlapp setup, and it works perfectly, and
>>>> everything displays.
>>>>
>>>> I'll be the first to admit that I'm not a guru or anything in OpenGL,
>>>> and especially GLSL (the only opengl i've done up to this point has been
>>>> OpenGL 1.1), so any help would be great.
>>>>
>>>> Take care, gents,
>>>> -Alex
>>>>
>>>>
>>>>
>>>> ______________________________**_________________
>>>> SDL mailing list
>>>> SDL at lists.libsdl.org
>>>> http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org<http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>
>>>>
>>>
>>>
>>> --
>>> LordHavoc
>>> Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/**
>>> darkplaces <http://icculus.org/twilight/darkplaces>
>>> Co-designer of Nexuiz - http://alientrap.org/nexuiz
>>> "War does not prove who is right, it proves who is left." - Unknown
>>> "Any sufficiently advanced technology is indistinguishable from a rigged
>>> demo." - James Klass
>>> "A game is a series of interesting choices." - Sid Meier
>>>
>>> ______________________________**_________________
>>> SDL mailing list
>>> SDL at lists.libsdl.org
>>> http://lists.libsdl.org/**listinfo.cgi/sdl-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/20111118/909fa518/attachment.htm>
More information about the SDL
mailing list