Skip to content

Commit

Permalink
Add flag to track wether glut has been initialized
Browse files Browse the repository at this point in the history
Signed-off-by: Honglei Huang <Honglei1.Huang@amd.com>
  • Loading branch information
Honglei Huang authored and Honglei Huang committed Jul 24, 2024
1 parent 7088415 commit 88c55a6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test_common/gl/setup_osx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,27 @@

class OSXGLEnvironment : public GLEnvironment
{
private:
bool m_is_glut_init;

public:
OSXGLEnvironment()
{
mCGLContext = NULL;
m_is_glut_init = false;
}

virtual int Init( int *argc, char **argv, int use_opengl_32 )
{
if (!use_opengl_32) {

// Create a GLUT window to render into
glutInit( argc, argv );
glutInitWindowSize( 512, 512 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "OpenCL <-> OpenGL Test" );
if (!m_is_glut_init) {
// Create a GLUT window to render into
glutInit( argc, argv );
glutInitWindowSize( 512, 512 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "OpenCL <-> OpenGL Test" );
m_is_glut_init = true;
}
}

else {
Expand Down

0 comments on commit 88c55a6

Please sign in to comment.