Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
38
Task/OpenGL/FreeBASIC/opengl.basic
Normal file
38
Task/OpenGL/FreeBASIC/opengl.basic
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include "fbgfx.bi"
|
||||
#include once "GL/gl.bi"
|
||||
#include once "GL/glu.bi"
|
||||
|
||||
screen 18, 16, , 2
|
||||
|
||||
glViewport 0, 0, 640, 480 'Set the viewport
|
||||
glMatrixMode GL_PROJECTION ' Select projection
|
||||
glLoadIdentity ' Set this to default
|
||||
gluPerspective 45.0, 640./480., 0.1, 100.0 ' Set perspective view options
|
||||
glMatrixMode GL_MODELVIEW ' Set to modelview mode
|
||||
glLoadIdentity ' ...and set it to default
|
||||
glClearColor 0.5, 0.5, 0.5, 0.0 ' Set clearscreen color to middle grey
|
||||
glShadeModel GL_SMOOTH ' set to smooth shading
|
||||
glClearDepth 1.0 ' Allow the deletion of the depth buffer
|
||||
glEnable GL_DEPTH_TEST ' turn on depth testing
|
||||
glDepthFunc GL_LEQUAL ' The Type Of Depth Test To Do
|
||||
glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ' niceness tweaks
|
||||
|
||||
do
|
||||
|
||||
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT ' clear screen and depth
|
||||
glLoadIdentity
|
||||
|
||||
glTranslatef 0.0f, 0.0f, -6.0f ' move camera back so we can see the triangle
|
||||
|
||||
glBegin GL_TRIANGLES ' Drawing Using Triangles
|
||||
glColor3f 1.0f, 0.0f, 0.0f ' red
|
||||
glVertex3f 0.0f, 1.0f, 0.0f ' Top
|
||||
glColor3f 0.0f, 1.0f, 0.0f ' green
|
||||
glVertex3f -1.0f,-1.0f, 0.0f ' Bottom Left
|
||||
glColor3f 0.0f, 0.0f, 1.0f ' blue
|
||||
glVertex3f 1.0f,-1.0f, 0.0f ' Bottom Right
|
||||
glEnd ' Finished Drawing The Triangle
|
||||
|
||||
flip
|
||||
|
||||
loop while inkey = ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue