; Hello World ; swapping between texture/frame buffer and the rendering loop ; Will Muto ; Create your window environment Graphics3D 640,480 ; Create our texture tex = CreateTexture(128,128) ; Allocate texture memory SetBuffer TextureBuffer(tex) ; Sends all draw calls to texture buffer ClsColor 255,0,0 ; Sets CLS to clear to Red Cls ; Clears buffer to Color defined above ; Now send draw commands to back buffer, not texture buffer SetBuffer BackBuffer() ; *IMPORTANT* ; Scene will not be visible without a camera camera=CreateCamera() ; Create sphere with 16 segments (960 polys) ; Defaults to 224 polys sphere = CreateSphere(16); ; Apply our texture to the sphere EntityTexture sphere, tex ; move sphere to x,y,z PositionEntity sphere,0,0,3 ; Main Render Loop ; Continue until [ESC] is pressed While Not KeyHit(1) UpdateWorld ; Updates objects if animated, and check collisions RenderWorld ; Dump frame to buffer Flip ; Swap front and back frame buffer Wend