I'm looking for one with a buffer all set up, and an animation loop running
I think I'd prefer SDL, but open to suggestions
== UPDATE: The solution I was hoping for
Code: Select all
''
'' SDL pixel ploting example
''
#include "SDL\SDL.bi"
Dim Shared As Integer WIN_WID = 320, WIN_HGT = 240
sub doRender( byval video as SDL_Surface ptr )
dim buffer as uinteger ptr
dim x as integer, y as integer
dim c as uinteger
dim i as integer
SDL_LockSurface( video )
for i = 1 to 1
x = rnd * (WIN_WID-1)
y = rnd * (WIN_HGT-1)
c = (rnd * 256) shl 8 ' 2^24
buffer = video->pixels + y * video->pitch + x * len( integer )
*buffer = c
next i
SDL_UnlockSurface( video )
end sub
dim result as unsigned integer
dim video as SDL_Surface ptr
dim event as SDL_Event
result = SDL_Init(SDL_INIT_EVERYTHING)
if result <> 0 then
end 1
end if
video = SDL_SetVideoMode( WIN_WID, WIN_HGT, 32, SDL_RESIZABLE ) 'or SDL_FULLSCREEN
if video = 0 then
SDL_Quit
end 1
end if
Do
if(event.type = SDL_VIDEORESIZE) then
WIN_wid = event.resize.w
WIN_hgt = event.resize.h
video = SDL_SetVideoMode( WIN_WID, WIN_HGT, 32, SDL_RESIZABLE )
End If
doRender video
SDL_Flip video
SDL_PumpEvents
loop until( (SDL_PollEvent( @event ) <> 0) and ((event.type = SDL_KEYDOWN) or (event.type = SDL_MOUSEBUTTONDOWN)) )
SDL_Quit