12-03-2004, 08:26 AM
defint a-z
option explicit
'$include: "sdl\sdl.bi"
'$include: "gl\gl.bi"
'$include: "gl\glu.bi
declare sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)
dim screen as SDL_Surface ptr
dim a as string
Dim X as integer
Dim Y as integer
Dim T as UBYTE
screen = SDL_SetVideoMode( 640, 480, 32, SDL_HWSURFACE or SDL_DOUBLEBUF)
if screen = 0 then
SDL_Quit
end 1
end if
do
a = inkey$
if a = chr$(27) then exit do
SDL_LockSurface (screen)
For X = 1 to 100
for Y = 1 to 100
Pset screen ,X,Y,23+X,43+Y,X,255 ' <-- add +X +Y anywhere in
next ' the parmitor list or even
next ' a +10 or somthing
SDL_unlocksurface (screen)
SDL_Flip screen
loop
SDL_Quit
end
sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)
dim cl as uinteger ptr
dim colkey as uinteger
dim Colptr as UBYTE ptr
colptr = @colkey : *colptr = R
colptr = @colkey + 1 : *colptr = G
colptr = @colkey + 2 : *colptr = B
colptr = @colkey + 3 : *colptr = A
cl = screen->pixels + y * screen->pitch + x * len( integer )
*cl = colkey
end sub
option explicit
'$include: "sdl\sdl.bi"
'$include: "gl\gl.bi"
'$include: "gl\glu.bi
declare sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)
dim screen as SDL_Surface ptr
dim a as string
Dim X as integer
Dim Y as integer
Dim T as UBYTE
screen = SDL_SetVideoMode( 640, 480, 32, SDL_HWSURFACE or SDL_DOUBLEBUF)
if screen = 0 then
SDL_Quit
end 1
end if
do
a = inkey$
if a = chr$(27) then exit do
SDL_LockSurface (screen)
For X = 1 to 100
for Y = 1 to 100
Pset screen ,X,Y,23+X,43+Y,X,255 ' <-- add +X +Y anywhere in
next ' the parmitor list or even
next ' a +10 or somthing
SDL_unlocksurface (screen)
SDL_Flip screen
loop
SDL_Quit
end
sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)
dim cl as uinteger ptr
dim colkey as uinteger
dim Colptr as UBYTE ptr
colptr = @colkey : *colptr = R
colptr = @colkey + 1 : *colptr = G
colptr = @colkey + 2 : *colptr = B
colptr = @colkey + 3 : *colptr = A
cl = screen->pixels + y * screen->pitch + x * len( integer )
*cl = colkey
end sub