FastDot2
FastDot2 Xpos, Ypos, RgbColour1, RgbColour2
 
Parameters:

    Xpos = The X coordinate of the dot
    Ypos = The Y coordinate of the dot
    RgbColour1 = The Rgb Colour of first dot
    RgbColour2 = The Rgb Colour of second dot
Returns: NONE
 


     FastDot2 draws a pair of pixels to the current surface starting at the users selected coordinate, with the second pixel to the right of the first. Making it a shortcut situations that require brute force pixel rendering.


      Example:

  
; Draws a pair of pixels
  FastDot2 Xpos,Ypos, ThisColour1,ThisColour2
  
;Is the same as this code
  FastDot Xpos  ,Ypos, ThisColour1
  FastDot Xpos+1,Ypos, ThisColour2
  





FACTS:


      * FastDot2 has all the same limitations as the FastDot


 
Example Source: Download This Example
; -----------------------------------------
; PRESS SPACE TO CHANGE TESTS
; -----------------------------------------
  
  
  Fill_Method=0
  
  
  Do
     
     Cls RGB(00,0,0)
     
     
     Select Fill_Method
         Case 0
             Fill_Screen_FastDot(Fill_Colour)
             
         Case 1
             Fill_Screen_FastDot2(Fill_Colour)
             
         Case 2
             Fill_Screen_FastDot3(Fill_Colour)
             
         Case 3
             Fill_Screen_FastDot4(Fill_Colour)
             
     EndSelect
     
     
     Fill_Colour+=GetScreenWidth()
     
     
     If SpaceKey()
        Fill_Method=(Fill_Method+1And 3
        FlushKeys
     EndIf
     
     
     Sync
  Loop
  
  
  
  
  
  
  
  
  
  
Function Fill_Screen_FastDot(ThisColour)
  
  Width= GetScreenWidth()-1
  
  LockBuffer
  ThisRgb=Point(0,0)
  
  For ylp= 0 To GetScreenHeight()-1
     
     // Fill Strip of pixels manually
     For xlp= 0 To Width
        FastDot xlp,ylp,ThisColour
     Next
     ThisColour=ThisColour + Width
  Next
  
  UnLockBuffer
  
  PrintMethod("FastDOT")
  
EndFunction
  
  
  
  
Function Fill_Screen_FastDot2(ThisColour)
  
  Width= GetScreenWidth()-1
  
  LockBuffer
  ThisRgb=Point(0,0)
  
  For ylp= 0 To GetScreenHeight()-1
     
     // Fill Strip of pixels manually in pairs
     For xlp= 0 To Width Step 2
        FastDot2 xlp,ylp,ThisColour,ThisColour
     Next
     ThisColour=ThisColour + Width
     
  Next
  
  UnLockBuffer
  
  PrintMethod("FastDOT2")
  
EndFunction
  
  
  
  
  
Function Fill_Screen_FastDot3(ThisColour)
  
  Width= GetScreenWidth()-1
  LockBuffer
  ThisRgb=Point(0,0)
  
  For ylp= 0 To GetScreenHeight()-1
     
     // Fill Strip of pixels manually in pairs
     For xlp= 0 To ((Width/3)*3)-1 Step 3
        FastDot3 xlp,ylp,ThisColour,ThisColour,ThisColour
     Next
     
     
     // Fill Left Overs on this row
     For xlp= xlp To Width
        FastDot xlp,ylp,ThisColour
     Next
     
     ThisColour=ThisColour + Width
     
  Next
  
  UnLockBuffer
  
  PrintMethod("FastDOT3")
  
EndFunction
  
  
  
  
Function Fill_Screen_FastDot4(ThisColour)
  
  Width= GetScreenWidth()-1
  
  LockBuffer
  ThisRgb=Point(0,0)
  
  For ylp= 0 To GetScreenHeight()-1
     
     // Fill Strip of pixels manually in quads
     For xlp= 0 To Width Step 4
        FastDot4 xlp,ylp,ThisColour,ThisColour,ThisColour,ThisColour
     Next
     ThisColour=ThisColour + Width
     
  Next
  
  UnLockBuffer
  
  PrintMethod("FastDOT4")
  
EndFunction
  
  
  
Function PrintMethod(Method$)
  
  Message$="Fill Screen("+Method$
  Message$+=":" +Str$(FPS())+")"
  Message$+=" Press Space"
  Print Message$
  
EndFunction
  
  
  
  
  
 
Related Info: Box | Circle | DotC | FastDot | FastDot3 | FastDot4 | FastPoint | GetInk | Ink | Line | LockBuffer | Point | Tri | UnLockBuffer :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com