may be using Palette library, but some of the modern VGA don't allow 8 bit depth modes
any idea would be welcome.



Thanks,Hroudtwolf wrote: Sorry, if I misunderstood "plasma".


Code: Select all
#ScreenWidth=800  ; Feel free to change this to see the pixel filling speed !
#ScreenHeight=600
Macro getdisplaydata
  StartDrawing(ScreenOutput())
  *Buffer.b=DrawingBuffer(); Get the start address of the screen buffer
  Pitch.l=DrawingBufferPitch(); Get the length (in byte) took by one horizontal line
  If DrawingBufferPixelFormat()=#PB_PixelFormat_32Bits_RGB; Get the pixel format.
    For i.w=0 To 255
      ColorTable(i)=i<<16; Blue is at the 3th pixel
    Next
  Else; Else it's 32bits_BGR
    For i=0 To 255
      ColorTable(i)=i; Blue is at the 1th pixel
    Next    
  EndIf
  StopDrawing()
EndMacro  
Macro writetodisplaymem
  For y.l=0 To #ScreenHeight-1
    pos1.l=CosTable(y+wave)
    *Line.Pixel=*Buffer+Pitch*y
    For x.l=0 To #ScreenWidth-1
      *Line\Pixel=ColorTable(CosTable(x+Wave)+CosTable(x+y)+pos1) ; Write the pixel directly to the memory !
      *Line+4
    Next
  Next
EndMacro
If InitSprite()=0 Or InitKeyboard()=0
  MessageRequester("Error","DirectX 7+ is needed.",0):End
EndIf
Structure Pixel
  Pixel.l
EndStructure
Dim CosTable.l(#ScreenWidth*2)
Dim ColorTable.l(255)
For i.w=0 To #ScreenWidth*2
  CosTable(i)=Sin(9/8*i*#PI/180.0)*32+32
Next
If OpenScreen(#ScreenWidth,#ScreenHeight,32,"PB Plasma")=0:MessageRequester("Error","Can't open the screen !",0):End:EndIf
getdisplaydata
FlipBuffers(#PB_Screen_NoSynchronization)
Repeat
  ExamineKeyboard()
  writetodisplaymem
  Wave+6
  If Wave>320:Wave=0:EndIf
  Delay(16)
Until KeyboardPushed(#PB_Key_Escape)

