Code: Select all
StartDrawing()
The sprite as been created , it's not null.
i don't understand the problem. bug ?
Code: Select all
StartDrawing()
Ill check it out, tnx!DarkDragon wrote:Here is the best solution ever:
http://www.purebasic.fr/english/viewtop ... 854#248854
I could also try to make it possible to draw directly on the screen. But it would also result in a code like this.
[EDIT]
Just noticed, that this code doesn't work right anymore. But it worked in PB 4.30 beta somenumber.
Philippe-felixer76-2 wrote:And is it possible to change the pixels realtime? Yes? How???GBeebe wrote:*pointer.sdl_surface = SpriteID(sprite) for sprites
*pointer.sdl_surface = ScreenID() for screen
all the pixel data is then in *pointer\pixels
Code: Select all
InitSprite()
OpenWindow(0,0,0,800,600,"")
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0)
CreateSprite(0,256,256)
Repeat
Event = WindowEvent()
ClearScreen($FF00FF)
*pointer.sdl_surface = SpriteID(0)
For x = 0 To 256-1
For y = 0 To 256-1
; Operation for GET or PUT any data in memory :
; Memory + ( x * DataOffset ) + MemoryWidth * ( y* DataOffset )
; if is Memory structured :
; (Memory + ( x * DataOffset ) + MemoryWidth * ( y* DataOffset ) ) + OffsetOf( Structure\Data )
PokeL(*pointer\Pixels + (x*4) + 256 * (y*4),RGB(x*255/64,x*255/64,y*255/64))
Next
Next
DisplaySprite(0,100,100)
FlipBuffers()
Until Event = #PB_Event_CloseWindow