02-03-2005, 02:40 AM
ok here a simple pure sdl example for you ray.
Code:
option explicit
'$include: "sdl\sdl.bi"
declare sub plot (surfacetemp as sdl_surface ptr,byval x as integer ,byval y as integer,byval R as UBYTE ,byval G as UBYTE,byval B as UBYTE)
Dim result as unsigned integer
result = SDL_Init(SDL_INIT_EVERYTHING)
if result <> 0 then
SDL_Quit
end 1
end if
dim surface1 as sdl_surface ptr
dim x as integer
dim y as integer
dim R as ubyte
dim G as ubyte
dim B as ubyte
surface1 = SDL_SetVideoMode(1280, 1024, 32,SDL_HWSURFACE or SDL_DOUBLEBUF or sdl_fullscreen)
SDL_LockSurface (surface1)
for x = 1 to 1280
for y = 1 to 1024
R = X+Y : R = R mod 200
G = Y-r : G = G mod 200
B = X+G : B = B mod 200
plot surface1,x,y,R,G,B
next
next
sdl_Unlocksurface (surface1)
sdl_flip surface1
sleep 1000
sdl_quit
end
sub plot (surfacetemp as sdl_surface ptr,byval x as integer ,byval y as integer, byval R as UBYTE ,byval G as UBYTE,byval B as UBYTE)
dim colkey as uinteger
colkey = SDL_MapRGB (surfacetemp->format, R, G, B)
dim cl_32bit as uinteger ptr
cl_32bit = surfacetemp->pixels + y * surfacetemp->pitch + x * len( integer )
*cl_32bit = colkey
end sub