Results 1 to 3 of 3

Thread: "Sealed" OpenGL Command Blocks ?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2004
    Location
    Greece
    Posts
    10

    "Sealed" OpenGL Command Blocks ?

    Is there a way to issue a batch of commands in OpenGL which have no effect to the outside world, just like Push-Pop Matrix.

    For example, I want my Rendering environment to have a specified Fill mode(Solid,wire,point). But I want each individual 3D objects to override it if they wish. In order to do that, I have to issue glPolygonMode before drawing the object that want fill mode different to that of the environment. After the drawing command I have to issue glPolygonMode again to restore the environments Fill Mode.

    Is there a way to avoid issuing twice such commands?

    Thank you.
    OpenGL under OpenTK,C#,Visual Studio

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649

    Re: "Sealed" OpenGL Command Blocks ?

    Quote Originally Posted by pontifikas
    Is there a way to issue a batch of commands in OpenGL which have no effect to the outside world, just like Push-Pop Matrix ... glPolygonMode before drawing ... glPolygonMode again to restore the environments Fill Mode.

    Is there a way to avoid issuing twice such commands?
    There is glPushAttrib/glPopAttrib, but the usual way is to do lazy state. That is have application "lazy state" wrappers around the GL state setting that only changes state if you know its changed.

  3. #3
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: "Sealed" OpenGL Command Blocks ?

    If you want to avoid multiple state switches, then just sort your objects by state.
    First draw objects that use the global setting, then draw objects that use custom setting.

Similar Threads

  1. "gl-streaming" - Lightweight OpenGL ES command streaming framework
    By shodruk in forum OpenGL: Advanced Coding
    Replies: 22
    Last Post: 04-24-2014, 05:48 AM
  2. egl gles2 "function is no-op" "Mesa: User error"
    By unixmania in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-17-2013, 05:30 AM
  3. Replies: 1
    Last Post: 10-26-2012, 02:19 AM
  4. opengl & linux -- "GLTools.h"&"GLShaderManager.h"
    By ggeo1 in forum OpenGL: Linux
    Replies: 1
    Last Post: 03-07-2011, 08:39 AM
  5. "best" linux dist for a "Gelato" render farm?
    By ArtificialArtOfficial in forum OpenGL: Linux
    Replies: 10
    Last Post: 12-23-2007, 01:02 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