Results 1 to 5 of 5

Thread: Problems using GLSL with GL_QUADS

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2012
    Posts
    3

    Problems using GLSL with GL_QUADS

    Hi,

    Been stuck on a real annoying problem and need some help. I got a very simple vertex and fragment shader which is working fine when I use GL_TRIANGLES but as soon as I switch to using to GL_QUADS all I get is a blank screen.

    I know the buffers are populated correctly with index and vertex data.

    My render function use glDrawElements(GL_QUADS,4,GL_UNSIGNED_BYTE,0);, this doesn't work but if I switch to glDrawElements(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,0); it works fine with the same buffers.

    Anyone have any idea what might be wrong?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325

    Re: Problems using GLSL with GL_QUADS

    Hi,

    any chance your on MacOS with OpenGL 3.2 where GL_QUADS are not supported?
    If not, do you get any errors from GL (glGetError) ?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2012
    Posts
    3

    Re: Problems using GLSL with GL_QUADS

    I am using the following in Windows.

    Driver supports OpenGL 3.3
    Using GLEW 1.5.6
    Vendor: NVIDIA Corporation
    Renderer: GeForce G105M/PCI/SSE2
    Version: 3.3.0
    GLSL: 3.30 NVIDIA via Cg compiler

    I don't see any useful Error msg.

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2012
    Posts
    3

    Re: Problems using GLSL with GL_QUADS

    Yeah looks like GL_QUADS isn't supported in OpenGL 3.1 or later version. Guess I have to rewrite my code using triangles then.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325

    Re: Problems using GLSL with GL_QUADS

    The windows drivers from NVidia should still support quads as long as you don't ask explicitly for a core context.

Similar Threads

  1. GL_QUADS not how they should be
    By PSMMet in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-11-2009, 02:38 AM
  2. GLSL problems on some cards
    By Phantasy in forum OpenGL: GLSL
    Replies: 0
    Last Post: 04-03-2007, 10:44 AM
  3. Severe problems with glsl...
    By Dr_Davenstein in forum OpenGL: GLSL
    Replies: 2
    Last Post: 05-23-2006, 05:02 PM
  4. GLSL performance problems
    By Ketracel White in forum OpenGL: GLSL
    Replies: 13
    Last Post: 10-06-2005, 10:12 PM
  5. problems using glsl with c++
    By gha in forum OpenGL: GLSL
    Replies: 1
    Last Post: 01-28-2005, 12:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean