Results 1 to 2 of 2

Thread: Mixing OpenGL immediate mode and shaders

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2011
    Posts
    4

    Mixing OpenGL immediate mode and shaders

    Hi,

    I have to mix an old program that uses OpenGL immediate mode and a new library that uses OpenGL shaders (version > 3.0). I'm not used to this kind of mixing...

    Basically, the main rendering loop is something like that:
    - Init some global states and matrices,
    - Drawing with immediate mode,
    - Drawing with shaders,
    - Drawing with immediate mode,
    - Swap buffer.

    It works fine, except I don't have depth test between the two rendering mode. It seems that the immediate mode is always over the shader drawing (with depth test enabled and depth write too).
    Is there something I have to check? Do I have to define the projection matrix exactly the same way? (I have some doubts about that...).

    Thanks.

  2. #2
    V-man
    Guest

    Re: Mixing OpenGL immediate mode and shaders

    I guess you should not call glDisable(GL_DEPTH_TEST).
    There is also glDepthMask to watch out for.

    Do I have to define the projection matrix exactly the same way?
    As long as the projection matrix values are the same, then it should be fine.

Similar Threads

  1. Get actual polygon rasterization mode inside shaders?
    By Pivonka in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-01-2019, 12:51 PM
  2. RE mixing GDI with OpenGL
    By remdul in forum OpenGL: Windows
    Replies: 1
    Last Post: 08-30-2011, 06:44 PM
  3. Mixing OpenGL and GDI
    By brookal in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-05-2005, 05:38 AM
  4. Mixing fixed function and vertex programs (shaders)
    By yooyo in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 04-23-2004, 01:38 AM
  5. Mixing GDI and OpenGL
    By Steve_7 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-15-2001, 09:41 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