I'm trying to run a simple OpenGL code:
1 from OpenGL.GL import *
2 from OpenGL.GLUT import *
3 from OpenGL.GLU import *
4
5 window = 0 # glut window number
6 width, height = 500, 400 # window size
7
8 def draw(): # ondraw is called all the time
9 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # clear the screen
10 glLoadIdentity() # reset position
11
12 # ToDo draw rectangle
13
14 glutSwapBuffers() # important for double buffering
15
16
17 # initialization
18 glutInit() # initialize glut
19 glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH)
20 glutInitWindowSize(width, height) # set window size
21 glutInitWindowPosition(0, 0) # set window position
22 window = glutCreateWindow("noobtuts.com") # create window with title
23 glutDisplayFunc(draw) # set draw function callback
24 glutIdleFunc(draw) # draw all the time
But everytime I try to execute it I get this error:
1 OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit,
According to this question The problem is that the glut.dll
and glut32.dll
are not part of the PyOpenGL
package. So I downloaded the dll files and copied them to C:/Windows/SysWOW64
and added that folder to PATH
, but the error persists. In the same question reference above, one user also suggests coping the dll files to the Python OpenGL DLL
folder.
Where can I find this folder in my Ananconda installation? Or where should I copy the dll files to make this work? Thanks
Using Vue JS
1 <template> 2 <div class="forum-view"> 3 <div class="forum-screen"> 4 <div v-if="isForumLoading"> 5 <ForumViewSkeleton /> 6 </div> 7 <div v-else> 8 <ForumViewComponent :forum="forum.documents[0]" /> 9 <RepliesComponent :forumId="forum.documents[0].$id" :isOpen="forum.documents[0].is_open" /> 10 </div> 11 <div class="related-blog-forum"> 12 <PopularRelatedTopics :is-blog-forum-view="true" /> 13 </div> 14 </div> 15 </div>