OpenGL: Difference between revisions

no edit summary
No edit summary
Line 192:
DllCall("FreeLibrary", "uInt", hOpenGL32)
ExitApp</lang>
 
 
=={{header|BaCon}}==
BaCon allows embedding C code. This is an example with GLUT.
<lang qbasic>PRAGMA INCLUDE <GL/gl.h> <GL/freeglut.h>
PRAGMA LDFLAGS GL glut
 
OPTION PARSE FALSE
 
SUB Triangle
 
glViewport(0, 0, 640, 480)
glOrtho(-30.0, 30.0, -30.0, 30.0, -30.0, 30.0)
 
glClearColor(0.0, 0.0, 0.0, 1.0)
glClear(GL_COLOR_BUFFER_BIT)
 
glTranslatef(-15.0, -15.0, 0.0)
 
glBegin(GL_TRIANGLES)
glColor3f(1.0, 0.0, 0.0)
glVertex2f(0.0, 0.0)
glColor3f(0.0, 1.0, 0.0)
glVertex2f(30.0, 0.0)
glColor3f(0.0, 0.0, 1.0)
glVertex2f(0.0, 30.0)
glEnd()
 
glutSwapBuffers()
 
END SUB
 
glutInit(&argc, argv)
glutInitWindowSize(640, 480)
glutCreateWindow("Triangle")
 
glutDisplayFunc(Triangle)
glutMainLoop()</lang>
 
=={{header|BBC BASIC}}==
Anonymous user