Results 1 to 4 of 4

Thread: Checking for GL_MAX_TEXTURE_IMAGE_UNITS

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    2

    Checking for GL_MAX_TEXTURE_IMAGE_UNITS

    Hello,

    I'm fairly new to OpenGl, but the project I am working on right now requires me to start exploring it.

    I know that GL_MAX_TEXTURE_IMAGE_UNITS will tell me the max texture image units that my video card supports, but is there a way to know how many are in use?

    Thanks for your time,

    piperfloyd

  2. #2
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: Checking for GL_MAX_TEXTURE_IMAGE_UNITS

    For each unit, for each target, you glGetIntegerv for the bound texture and whether it's enabled. It's generally useless to know how many are in use.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,655

    Re: Checking for GL_MAX_TEXTURE_IMAGE_UNITS

    Quote Originally Posted by piperfloyd
    I know that GL_MAX_TEXTURE_IMAGE_UNITS will tell me the max texture image units that my video card supports, but is there a way to know how many are in use?
    What do you mean "in use" exactly?

    If you are using the fixed-function pipeline, you can query which texture units are enabled and which are disabled. That'll tell you which ones will be used the next time you draw something.

    If you are using shaders, you can really kinda do the same thing. But you may be asking how many textures a specific shader makes use of, even before you've actually set up your texture units to draw with that shader. In which case you can iterate over the uniforms and see which of them are samplers.

    If you need more specific help, please follow-up with whether you're doing fixed-function pipeline or shaders here, and someone will help you out.

  4. #4
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    2

    Re: Checking for GL_MAX_TEXTURE_IMAGE_UNITS

    Thanks, for the answers. I am new to OpenGl, so my understanding of things is still flaky. I realized now though that I don't really need to know how many textures are in use. thanks

Similar Threads

  1. GL_MAX_TEXTURE_IMAGE_UNITS on mac
    By robinfaury in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 07-18-2016, 08:01 AM
  2. Makefile checking
    By charisma in forum OpenGL: Linux
    Replies: 5
    Last Post: 03-03-2011, 08:07 PM
  3. Automatic dependancy checking.
    By thurgold in forum OpenCL
    Replies: 3
    Last Post: 02-20-2010, 04:47 AM
  4. Checking For Extensions
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-14-2003, 02:09 PM
  5. Checking if I'm right :)
    By M/\dm/\n in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-20-2002, 11:46 AM

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