All pastes #587496 Raw Edit

Anonymous

public text v1 · immutable
#587496 ·published 2007-06-24 17:03 UTC
rendered paste body
Graphics 800,600,0
VirtualGraphics 640,480
While Not KeyDown(KEY_ESCAPE)
DrawText("lol",16,16)
DrawText("rofl",128,128)
Flip
Wend

Function VirtualGraphics(width=640, height=480)
?Win32
  Local D3D7Driver:TD3D7Max2DDriver = TD3D7Max2DDriver(_max2dDriver)
    
  If D3D7Driver
    Local matrix#[] = [2.0 / width, 0.0, 0.0, 0.0,..
                  0.0, -2.0 / height, 0.0, 0.0,..
                  0.0, 0.0, 1.0, 0.0,..
                  -1 - (1.0 / width), 1 + (1.0 / height), 1.0, 1.0]
    
    D3D7Driver.device.SetTransform(D3DTS_PROJECTION, matrix)
  Else
? 
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    
    glortho(0, width, height, 0, 0, 1)
    
    glMatrixMode(GL_MODELVIEW)
    glLoadIdentity()
?Win32
  EndIf
?
End Function