OpenGL Profiler allows you to execute (at a performance cost) small amounts of OpenGL code or other scripting calls when your application pauses at a breakpoint. A script is a text file that contains OpenGL function calls. For example, a script can be as simple as the following line of code:
glClear(1.0, 0.0, 0.0, 1.0); |
Or it can be more complex, containing many lines of code, such as:
glBegin(GL_POINTS); |
glVertex3f(0,0,1); |
glVertex3f(1,0,1); |
glVertex3f(1,1,1); |
glVertex3f(0,1,1); |
glEnd(); |
You can create a script using any text editor, or you can enter a script directly into the Scripts window.
To add a script:
Choose Views > Scripts to open the Scripts window.

If you created the script in a text editor, click Open, navigate to the script, and choose it. If you want to create a script in the Scripts window, click the plus (+) button, enter a script name, then type commands in the text window on the right.
Any script that you add in the Scripts window will be available from the Breakpoints window.
After you add a script to OpenGL Profiler, you can either execute it manually or attach it to a breakpoint.
To execute a script manually when your application pauses at a breakpoint:
Choose a script in the Scripts window.
Click Execute.
OpenGL Profiler sends the commands to your application for execution. Errors in your script appear in the pane located in the lower left of the Scripts window.
To attach a script to a breakpoint:
Open the Breakpoints window.
Choose Actions > Attach Script.
In the sheet that appears, choose a script.
Select one or more execution options.
You can choose to have OpenGL Profiler execute the script before, after, or both before and after the OpenGL function. You can also choose to have your application continue after executing the script.
Click Attach.
A small document icon appears in the functions list next to the blue breakpoint indicator for the function.
Note: Attaching a script to a function that your application uses repeatedly is an expensive operation. Data that you look at when the script executes is not an accurate measure of performance.
To remove a script from a breakpoint, choose Actions > Remove Script.
Last updated: 2008-02-08