Hello, here is a small opengl library for small games and other things.
You can find everything in the gfx.zip file.
The oxygen.dll is from 2015, if a newer dll runs I have not tested yet.
Peter
demo1
include "ogl.inc"
window 800,600,1
SetFrames 60
fon = LoadFont ("gfx/font05.bmp")
boy = LoadTiles("gfx/skulls.bmp",16,4)
cub = LoadImage("gfx/cube.tga")
type digger
sys x
sys y
sys z
sys d
end type
digger dig[3]
sys f
dig[0].x=0 : dig[0].Y=96
dig[1].x=736 : dig[1].y=160
dig[2].x=336 : dig[2].y=536
dig[3].x=400 : dig[3].y=0
while KeyDown(VK_ESCAPE)=0
cls 0,0,0
Text fon,300,16,"TILE DEMO",16,32
if dig[0].d=0
DrawTile boy,dig[0].x,dig[0].y,64,64,dig[0].z,0
dig[0].x +=1
dig[0].z +=1
if dig[0].z=16 then dig[0].z=0
if dig[0].x>=736 then dig[0].d=1
end if
if dig[0].d=1
DrawTile boy,dig[0].x,dig[0].y,64,64,dig[0].z,1
dig[0].x -=1
dig[0].z +=1
if dig[0].z=16 then dig[0].z=0
if dig[0].x<=0 then dig[0].d=0
end if
if dig[1].d=0
DrawTile boy,dig[1].x,dig[1].y,64,64,dig[1].z,1
dig[1].x -=1
dig[1].z +=1
if dig[1].z=16 then dig[1].z=0
if dig[1].x<=0 then dig[1].d=1
end if
if dig[1].d=1
DrawTile boy,dig[1].x,dig[1].y,64,64,dig[1].z,0
dig[1].x +=1
dig[1].z +=1
if dig[1].z=16 then dig[1].z=0
if dig[1].x>=736 then dig[1].d=0
end if
if dig[2].d=0
DrawTile boy,dig[2].x,dig[2].y,64,64,dig[2].z,2
dig[2].y -=1
dig[2].z +=1
if dig[2].z=16 then dig[2].z=0
if dig[2].y=0 then dig[2].d=1
end if
if dig[2].d=1
DrawTile boy,dig[2].x,dig[2].y,64,64,dig[2].z,3
dig[2].y +=1
dig[2].z +=1
if dig[2].z=16 then dig[2].z=0
if dig[2].y>=536 then dig[2].d=0
end if
if dig[3].d=0
DrawTile boy,dig[3].x,dig[3].y,64,64,dig[3].z,3
dig[3].y +=1
dig[3].z +=1
if dig[3].z=16 then dig[3].z=0
if dig[3].y=536 then dig[3].d=1
end if
if dig[3].d=1
DrawTile boy,dig[3].x,dig[3].y,64,64,dig[3].z,2
dig[3].y -=1
dig[3].z +=1
if dig[3].z=16 then dig[3].z=0
if dig[3].y=0 then dig[3].d=0
end if
DrawImage cub,250,268,f
FlipImageH cub,350,268,64,64,f
FlipImageV cub,452,268,64,64,f
f +=1
if f=32 then f=0
Flip
wait 30
wend
WinEnd
demo2
include "ogl.inc"
window 640,480,1
font=LoadFont ("gfx/font32.bmp")
skul=LoadImage("gfx/skull.tga" )
sys w=screenW
sys h=screenH
float a
while KeyDown(VK_ESCAPE)=0
cls 0,0,255
RotateImage skul,296,290,2,2,a,0
Text font,96,32,"Screen Resolution "+w+"x"+h,18,26
Text font,16,64,"Screen Resolution "+w+"x"+h,24,32
Text font,158,120,"I am PeterMaria",16,16
Flip
a +=2.5
if a>=360 then a=-a
wend
WinEnd 'tidy up
Demo3
include "ogl.inc"
Window 480,240,1
SetFrames 60
fon = LoadFont("gfx/font32.bmp")
hnd = OpenFile "gfx/knot.raw"
sys size = FileSize(hnd)
sys a=GetMemory size
ReadByte hnd, *a,size
CloseFile hnd
hnd = OpenFile "gfx/skull.raw"
sys size = FileSize(hnd)
sys c=GetMemory size
ReadByte hnd, *c,size
CloseFile hnd
Sub RawImage(sys x0,y0,mem)
for y=0 to 128
for x=0 to 128
z=(y*128+x)*3
r=Peek mem,z+0
g=Peek mem,z+1
b=Peek mem,z+2
if r>0 or g>0 or b>0
Color r, g, b, 255
SetPixel x+x0,y+y0
end if
next
next
End Sub
while KeyDown(vk_escape)=0
Cls 0,0,0
Text fon,56,8,"ALLIANCE KNOT",16,16
RawImage 64 ,50,a
RawImage 256,50,c
Flip
wend
FreeMemory (a)
FreeMemory (c)
WinEnd
demo4
include "ogl.inc"
window 1024,768,1
Enable GL_POINT_SMOOTH
int width = 1024/2
int height= 768/2
int a=1,d=1, single r,sx,sy
Sub vec(single x,y,z)
if z>0 then Return
if z=0 then z=-0.01
ps = (1/z)*10000
sx = x*ps+width
sy = y*ps+height
color rand(128,255),rand(128,255),rand(128,255),255
FillCircle(sx,sy,2)
End Sub
while Key(27)=0
cls 0,0,0
for i=1 to 1000
vec(cos(i*r+a),sin(i*r-a),-i/a)
next
Flip
if a <=20 and d=1
a +=0.01
else
d=2
end if
if a >=0.05 and d=2
a -=0.1
else
d=1
end iF
r +=0.001
if r >=360 then r=-r
wend
WinEnd