The GetSceneCacheSize function will return the current size of the Scene buffer cache.
FACTS:
* Use SceneCacheSize to change the scene buffers size.
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 eveything 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 Default Size:"+Str$(GetSceneCacheSize()) ; Resize the Scene Cache Size to 5000 bytes (5 k) SceneCacheSize 5000 ; Display the new size of the scene buffer Print "Scene New 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 this example outputs 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 |
|