Here is some sample gl to make a wavy matrix.
`********************************************************************************************
`********************************************************************************************
Window(800,600,32,0) :`Create GL window 800x600x32bit,window Put a 1 in place of 0 for fullscreen
glPolygonMode( GL_BACK, GL_FILL ):` // Back Face Is Filled In
glPolygonMode( GL_FRONT, GL_FILL ):` // Front Face Is Filled In
`points as double float
Dim points( 45 , 45 ,3) as double float:` // The Array For The Points On The Grid Of Our "Wave"
wiggle_count = 0:` // Counter Used To Control How Fast Flag Waves
hold as float
cnt1 as float
cnt2 as float
float_x as double float
float_y as double float
float_xb as double float
float_yb as double float
xrot as float
yrot as float
zrot as float
x1 as float
y1 as float
pi as double float=3.141592654
Print "Debug:Scene Created"
fpstime=Timer()
for x=0 to 44
x1=x
:`// Loop Through The Y Plane
for y=0 to 44
y1=y
:` // Apply The Wave To Our Mesh
points(x,y,0)=((x1/5.0)-4.5)
points(x,y,1)=((y1/5.0)-4.5)
points(x,y,2)=(sin((((x1/.2)*180.0)/360.0)*pi*2.0))
next y
next x
do
b=b+1
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT):` // Clear The Screen And Depth Buffer
glDisable(GL_BLEND)
glLoadIdentity():` // Reset The Current Matrix
glTranslatef(0.0,0.0,-12.0):` // Translate 12 Units Into The Screen
glRotatef(xrot,1.0,0.0,0.0):` // Rotate On The X Axis
glRotatef(yrot,0.0,1.0,0.0):` // Rotate On The Y Axis
glRotatef(zrot,0.0,0.0,1.0):` // Rotate On The Z Axis
glBindTexture(GL_TEXTURE_2D, 2):` // Select Our Texture
glBegin(GL_QUADS):` // Start Drawing Our Quads
for x = 0 to 43:` // Loop Through The X Plane (44 Points)
x1=x
for y = 0 to 43 :` // Loop Through The Y Plane (44 Points)
y1=y
float_x = (x1)/44.0:` // Create A Floating Point X Value
float_y = (y1)/44.0:` // Create A Floating Point Y Value
float_xb = (x1+1)/44.0:` // Create A Floating Point Y Value+0.0227f
float_yb = (y1+1)/44.0:` // Create A Floating Point Y Value+0.0227f
glTexCoord2f( float_x, float_y):` // First Texture Coordinate (Bottom Left)
glVertex3f( points(x,y,0), points(x,y,1), points(x,y,2) ):`
glTexCoord2f( float_x, float_yb ):` // Second Texture Coordinate (Top Left)
glVertex3f( points(x,y+1,0), points(x,y+1,1), points(x,y+1,2) ):`
glTexCoord2f( float_xb, float_yb ):` // Third Texture Coordinate (Top Right)
glVertex3f( points(x+1,y+1,0), points(x+1,y+1,1), points(x+1,y+1,2) ):`
glTexCoord2f( float_xb, float_y ):` // Fourth Texture Coordinate (Bottom Right)
glVertex3f( points(x+1,y,0), points(x+1,y,1), points(x+1,y,2) ):`
next y
next x
glEnd():` // Done Drawing Our Quads
`if wiggle_count = 0 :` // Used To Slow Down The Wave (Every 2nd Frame Only)
for y = 0 to 44:` // Loop Through The Y Plane
hold=points(0,y,2):` // Store Current Value One Left Side Of Wave
for x = 0 to 43:` // Loop Through The X Plane
:`// Current Wave Value Equals Value To The Right
points(x,y,2) = points(x+1,y,2)
points(44,y,2)=hold:` // Last Value Becomes The Far Left Stored Value
wiggle_count = 0:` // Set Counter Back To Zero
next x
next y
`endif
`inc wiggle_count,1:` // Increase The Counter
inc xrot,0.3:` // Increase The X Rotation Variable
inc yrot,0.2:` // Increase The Y Rotation Variable
inc zrot,0.4:` // Increase The Z Rotation Variable
glEnable(GL_BLEND)
glLoadIdentity()
glColor3f(1.0*cos(cnt1),1.0*sin(cnt2),1.0-0.5*cos(cnt1+cnt2))
glPrint(int((280+250*cos(cnt1*2))),int(235+200*sin(cnt2*2)),"Dark Basic Pro",0) :` Print GL Text To The Screen
glColor3f(1.0*sin(cnt2),1.0-0.5*cos(cnt1+cnt2),1.0*cos(cnt1))
glPrint(int((280+230*cos(cnt2*2))),int(235+200*sin(cnt1*2)),"And OpenGL",1) :` Print GL Text To The Screen
glColor3f(0.0,0.0,1.0) :` Set Color To Blue
glPrint(int(240+200*cos((cnt2*2)+(cnt1*2)/5)),2,"More power than you can shake a stick at!",0)
glColor3f(1.0,1.0,1.0) :` Set Color To White
glPrint(int(242+200*cos((cnt2*2)+(cnt1*2)/5)),2,"More power than you can shake a stick at!",0)
glprint(0,2,str$(fps),0)
inc cnt1,0.5
inc cnt2,0.405
set cursor 00,60
Print "Debug:Called Engine and Returned ";enginecount;" Times"
set cursor 0,80
print fps;" "
set cursor 0,100
Print " "
set cursor 0,100
if flag=0
print "Debug:CPU Usage=High"
Else
Print "Debug:CPU Usage=Low"
endif
inc enginecount,1
if a=1 then quit()
if timer()-fpsTime>1000
cpu=cpu+1
fps=b:b=0:fpstime=Timer()
endif
if cpu=5
if flag=1
sync on:flag=0
else sync off:flag=1
endif
cpu=0
endif
Flip()
`sync
if wm_close=1 then quit()
loop
Make sure you don't call window twice. Currently the dll will try to create another window and will go into a infinate loop.