SceneCacheSize
SceneCacheSize Size
 
Parameters:

    Size = The Size of the scene buffer cache in bytes
Returns: NONE
 

      SceneCacheSize allows you to change the size (amount of memory) used by scene buffer.



FACTS:


      * Note: Please use great caution when changing the size of the scene cache, as PlayBasic assumes the scene cache is be big enough for any graphics rendering data you capture into it. So If you make it too small and your captures overflow it, PlayBASIC will either pop a runtime error or possibly crash !




Mini Tutorial:


      This example creates a camera, then resizes the scene buffer size from it's default of 460,000 bytes, to a much smaller 5000 bytes (5k) then captures some circles to the scene. As each circle is captured, it displays the current offset (amount of used space) in the scene buffer. Once everything is captured it draws the camera to display the scene.


  
  
; create a camera
  CreateCamera 1
  
; turn off auto cls in the camera
  CameraCls 1,off
  
; Display the default size of the scene buffer
  Print "Scene Buffer Default Size:"+Str$(GetSceneCacheSize())
  
; Resize the Scene Buffer Cache Size to 5000 bytes (5 k)
  SceneCacheSize 5000
  
; Display the new size of the scene buffer
  Print "Scene Buffer Custom Size:"+Str$(GetSceneCacheSize())
  
  For Lp=0 To 10
   ; Tell PB to Capture the following gfx drawing commands
     CaptureToScene
     
   ; Draw a circle to the Scene buffer
     CircleC RndRange(100,800),RndRange(100,600),_
     RndRange(5,20),true,RndRGB()
     
   ; Tell PB to stop Capturing and return to drawing
   ; graphics immeditately
     DrawGFXImmediate
     
   ; Display the current Scene Buffer Cache offset
     Print "Cache Offset:"+Str$(GetCurrentSceneOffset())
  Next
  
; Display
  Print "done"
  
; call draw camera to display trhe captured items in the
; scene buffer
  DrawCamera 1
  
; Show the Screen to the user and wait for a key press
  Sync
  WaitKey
  
  



      In PlayBasic V1.28 this example would output the following text.

  
  Scene Buffer Default Size:459999
  Scene Buffer Custom Size:4999
  Cache Offset:132
  Cache Offset:264
  Cache Offset:396
  Cache Offset:528
  Cache Offset:660
  Cache Offset:792
  Cache Offset:924
  Cache Offset:1056
  Cache Offset:1188
  Cache Offset:1320
  Cache Offset:1452
  

 
Related Info: CaptureToScene | SceneMaxZdepth | SceneSortMethod :
 


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