Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: How to activate subroutine uniform and subroutine?

  1. #1
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    20

    How to activate subroutine uniform and subroutine?

    I strictly followed instructions in section "Shader Subroutines" of Chapter 2 of the red book for OenGL 4.5, but I always got -1 return from glGetSubroutineUniformLocation and glGetSubroutineIndex. The code is exactly copied from the book and I have checked again and again for any syntax error. The code is minimized and the newest driver installed -- everything a newbie OpenGL programmer could figure out is tried. So I have to guess that the subroutine uniform and subroutine are not active and there are some APIs not covered by the red book can activate them. If so, what are they? If not, what is wrong with my code and how to fix it?

    Environment: Windows 7, Visual Studio 2015, GeForce 640, newest nVidia driver 384.76 installed

    Source code: Please see the attachement.

    Thanks a lot.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •