Try this:
Code: Select all
#include "gl/gl.bi"
Screenres 640,480,32,,2',,GFX_OPENGL =2
Dim as any ptr buffer=imagecreate(640,480,32)
line buffer,(20,20)-(200,200),rgb(40,78,200),bf
circle buffer,(100,100),50,rgb(0,200,0),,,,f
dim as long x,y
#macro GetColor(_x,_y,colour)
pixel=row+pitch*(_y)+(_x)*4
(colour)=*pixel
#endmacro
Dim As Integer pitch
Dim As Any Pointer row
Dim As Ulong Pointer pixel
Dim As Ulong col
imageinfo buffer,,,,pitch,row
glortho(0,640,480,0,-1,1)
do
glClear (GL_COLOR_BUFFER_BIT)
glbegin (gl_points)
for x=0 to 640
for y=0 to 480
GetColor(x,y,col)
glcolor3ub(Cptr(Ubyte Ptr,@col)[2],Cptr(Ubyte Ptr,@col)[1],Cptr(Ubyte Ptr,@col)[0])
glvertex2f(x,y)
''Pset(x,y),col'----Any Gl equivalent?
next
Next
glend
Flip
sleep 1,1
loop until len(inkey)
You can also attach a freebasic image to any Quad surface.
But I am following up your requirement.