Date: 02-16-2022
Return to Index
created by gbSnippets
'In case you wonder how many of the OpenGL functions and equates are needed for everday
'use, here is a list of those required for all of the OpenGL examples I provide in gbSnippets.
Declare Sub glPixelStorei LIB "OPENGL32.DLL" ALIAS "glPixelStorei" (ByVal pname AS DWord, ByVal param As Long)
Declare Sub glBindTexture LIB "OPENGL32.DLL" ALIAS "glBindTexture" (ByVal target AS DWord, ByVal texture AS DWord)
Declare Sub glTexParameterf LIB "OPENGL32.DLL" ALIAS "glTexParameterf" (ByVal target AS DWord, ByVal pname AS DWord, ByVal param AS SINGLE)
Declare Sub glTexEnvf LIB "OPENGL32.DLL" ALIAS "glTexEnvf" (ByVal target AS DWord, ByVal pname AS DWord, ByVal param AS SINGLE)
Declare Sub glTexImage2D LIB "OPENGL32.DLL" ALIAS "glTexImage2D" (ByVal target AS DWord, ByVal level As Long, ByVal internalformat As Long, ByVal Width As Long, ByVal height As Long, ByVal border As Long, ByVal format AS DWord, ByVal Type AS DWord, BYREF Pixels AS ANY)
Declare Function gluNewQuadric LIB "GLU32.DLL" ALIAS "gluNewQuadric" () AS DWord
Declare Sub glBegin LIB "OPENGL32.DLL" ALIAS "glBegin" (ByVal Mode AS DWord )
Declare Sub glCallList LIB "OPENGL32.DLL" ALIAS "glCallList" (ByVal list AS DWord)
Declare Sub glClear LIB "OPENGL32.DLL" ALIAS "glClear" (ByVal mask AS DWord)
Declare Sub glClearColor LIB "OPENGL32.DLL" ALIAS "glClearColor" (ByVal red AS SINGLE, ByVal green AS SINGLE, ByVal blue AS SINGLE, ByVal alpha AS SINGLE)
Declare Sub glClearDepth LIB "OPENGL32.DLL" ALIAS "glClearDepth" (ByVal depth AS DOUBLE)
Declare Sub glColor3f LIB "OPENGL32.DLL" ALIAS "glColor3f" (ByVal red AS SINGLE, ByVal green AS SINGLE, ByVal blue AS SINGLE)
Declare Sub glColor3fv LIB "OPENGL32.DLL" ALIAS "glColor3fv" (BYREF v AS SINGLE)
Declare Sub glColor3ub LIB "OPENGL32.DLL" ALIAS "glColor3ub" (ByVal red AS BYTE, ByVal green AS BYTE, ByVal blue AS BYTE)
Declare Sub glDepthFunc LIB "OPENGL32.DLL" ALIAS "glDepthFunc" (ByVal func AS DWord)
Declare Sub glDisable LIB "OPENGL32.DLL" ALIAS "glDisable" (ByVal cap AS DWord)
Declare Sub glEnable LIB "OPENGL32.DLL" ALIAS "glEnable" (ByVal cap AS DWord)
Declare Sub glEnd LIB "OPENGL32.DLL" ALIAS "glEnd" ()
Declare Sub glEndList LIB "OPENGL32.DLL" ALIAS "glEndList" ()
Declare Sub glFrustum LIB "OPENGL32.DLL" ALIAS "glFrustum" (ByVal left AS DOUBLE, ByVal right AS DOUBLE, ByVal bottom AS DOUBLE, ByVal top AS DOUBLE, ByVal zNear AS DOUBLE, ByVal zFar AS DOUBLE)
Declare Sub glHint LIB "OPENGL32.DLL" ALIAS "glHint" (ByVal target AS DWord, ByVal Mode AS DWord)
Declare Sub glLightfv LIB "OPENGL32.DLL" ALIAS "glLightfv" (ByVal light AS DWord, ByVal pname AS DWord, BYREF params AS SINGLE)
Declare Sub glLineWidth LIB "OPENGL32.DLL" ALIAS "glLineWidth" (ByVal Width AS SINGLE)
Declare Sub glLoadIdentity LIB "OPENGL32.DLL" ALIAS "glLoadIdentity" ()
Declare Sub glMatrixMode LIB "OPENGL32.DLL" ALIAS "glMatrixMode" (ByVal Mode AS DWord)
Declare Sub glNewList LIB "OPENGL32.DLL" ALIAS "glNewList" (ByVal list AS DWord, ByVal Mode AS DWord)
Declare Sub glOrtho LIB "OPENGL32.DLL" ALIAS "glOrtho" (ByVal left AS DOUBLE, ByVal right AS DOUBLE, ByVal bottom AS DOUBLE, ByVal top AS DOUBLE, ByVal zNear AS DOUBLE, ByVal zFar AS DOUBLE)
Declare Sub glPointSize LIB "OPENGL32.DLL" ALIAS "glPointSize" (ByVal Size AS SINGLE)
Declare Sub glPolygonMode LIB "OPENGL32.DLL" ALIAS "glPolygonMode" (ByVal face AS DWord, ByVal Mode AS DWord)
Declare Sub glPopMatrix LIB "OPENGL32.DLL" ALIAS "glPopMatrix" ()
Declare Sub glPushMatrix LIB "OPENGL32.DLL" ALIAS "glPushMatrix" ()
Declare Sub glRotatef LIB "OPENGL32.DLL" ALIAS "glRotatef" (ByVal angle AS SINGLE, ByVal x AS SINGLE, ByVal y AS SINGLE, ByVal z AS SINGLE)
Declare Sub glScalef LIB "OPENGL32.DLL" ALIAS "glScalef" (ByVal x AS SINGLE, ByVal y AS SINGLE, ByVal z AS SINGLE)
Declare Sub glShadeModel LIB "OPENGL32.DLL" ALIAS "glShadeModel" (ByVal Mode AS DWord)
Declare Sub glTranslatef LIB "OPENGL32.DLL" ALIAS "glTranslatef" (ByVal x AS SINGLE, ByVal y AS SINGLE, ByVal z AS SINGLE)
Declare Sub gluLookAt LIB "GLU32.DLL" ALIAS "gluLookAt" (ByVal eyex AS DOUBLE, ByVal eyey AS DOUBLE, ByVal eyez AS DOUBLE, ByVal centerx AS DOUBLE, _
ByVal centery AS DOUBLE, ByVal centerz AS DOUBLE, ByVal upx AS DOUBLE, ByVal upy AS DOUBLE, ByVal upz AS DOUBLE)
Declare Sub gluPerspective LIB "GLU32.DLL" ALIAS "gluPerspective" ( ByVal fovy AS DOUBLE, ByVal aspect AS DOUBLE, ByVal zNear AS DOUBLE, ByVal zFar AS DOUBLE)
Declare Sub gluQuadricNormals LIB "GLU32.DLL" ALIAS "gluQuadricNormals" (ByVal quadObject AS DWord, ByVal normals AS DWord)
Declare Sub gluQuadricTexture LIB "GLU32.DLL" ALIAS "gluQuadricTexture" (ByVal quadObject AS DWord, ByVal textureCoords AS BYTE)
Declare Sub gluSphere LIB "GLU32.DLL" ALIAS "gluSphere" (ByVal qobj AS DWord, ByVal radius AS DOUBLE, ByVal slices As Long, ByVal satcks As Long)
Declare Sub glVertex3f LIB "OPENGL32.DLL" ALIAS "glVertex3f" (ByVal x AS SINGLE, ByVal y AS SINGLE, ByVal z AS SINGLE)
Declare Sub glViewport LIB "OPENGL32.DLL" ALIAS "glViewport" (ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal height As Long)
%GLU_FALSE = 0
%GLU_FLAT = 100001
%GLU_SMOOTH = 100000
%GLU_TRUE = 1
%GL_AMBIENT = &H1200
%GL_COLOR_BUFFER_BIT = &H00004000
%GL_COMPILE = &H1300
%GL_DEPTH_BUFFER_BIT = &H00000100
%GL_DEPTH_TEST = &H0B71
%GL_DIFFUSE = &H1201
%GL_FALSE = 0
%GL_FASTEST = &H1101
%GL_FLAT = &H1D00
%GL_LESS = &H0201
%GL_LIGHT0 = &H4000
%GL_LIGHT1 = &H4001
%GL_LIGHT2 = &H4002
%GL_LIGHT3 = &H4003
%GL_LIGHTING = &H0B50
%GL_LINES = &H0001
%GL_LINE_LOOP = &H0002
%GL_LINE_SMOOTH = &H0B20
%GL_LINE_SMOOTH_HINT = &H0C52
%GL_LINE_STRIP = &H0003
%GL_MODELVIEW = &H1700
%GL_MODELVIEW = &H1700
%GL_NICEST = &H1102
%GL_PERSPECTIVE_CORRECTION_HINT = &H0C50
%GL_POINTS = &H0000
%GL_POINT_SMOOTH = &H0B10
%GL_POLYGON = &H0009
%GL_POSITION = &H1203
%GL_PROJECTION = &H1701
%GL_PROJECTION = &H1701
%GL_QUADS = &H0007
%GL_QUAD_STRIP = &H0008
%GL_SMOOTH = &H1D01
%GL_SPECULAR = &H1202
%GL_TRIANGLES = &H0004
%GL_TRIANGLE_FAN = &H0006
%GL_TRIANGLE_STRIP = &H0005
%GL_TRUE = 1
%GL_POINT_SMOOTH_HINT = &H0C51
'gbs_00581
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm