Skip to content

Instantly share code, notes, and snippets.

@FlandreDaisuki
Last active March 12, 2016 06:40
Show Gist options
  • Save FlandreDaisuki/daa955531b268826e998 to your computer and use it in GitHub Desktop.
Save FlandreDaisuki/daa955531b268826e998 to your computer and use it in GitHub Desktop.
Windows suck!!!!

Go to

http://opencv.org/

Extract it and find build/

Copy *.pyd into path/of/your/python/DLL

For example

Your python in C:\python27

Then put build/*.pyd in C:\python27\DLL

Done

Go to

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Download PyOpenGL.*.whl

Then

pip install PyOpenGL.*.whl

Done

Here is the test code:

import OpenGL
from OpenGL.GL import *
from OpenGL.GLUT import *
import sys

delta = 0.0

def display():
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
	glLoadIdentity()
	glRotatef(delta, 0.0, 1.0, 0.0)
	glutWireTeapot(0.5)
	glutSwapBuffers()

def reshape(width, height):
	glViewport(0, 0, width, height)

def keyboard(key, x, y):
	print(key)
	# press space key to exit
	if key == b' ':
		sys.exit( )

def idle():
	global delta
	delta += 0.5
	glutPostRedisplay()

if __name__ == '__main__':
	glutInit()

	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA)
	glutCreateWindow('Hello world!')
	glutReshapeWindow(512, 512)
	glutReshapeFunc(reshape)
	glutDisplayFunc(display)
	glutIdleFunc(idle)
	glutKeyboardFunc(keyboard)

	glutMainLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment