Last active
April 29, 2016 16:43
-
-
Save jerstlouis/d7369a2df831ffcc2e1fc8617774d14c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "ecere" | |
class Min3D : Window | |
{ | |
caption = "Hello, 3D"; | |
borderStyle = sizable; | |
hasMaximize = true; | |
hasMinimize = true; | |
hasClose = true; | |
clientSize = { 640, 480 }; | |
displayDriver = "OpenGL"; | |
Cube cube { }; | |
Camera camera { position = { 0, 0, -5 } }; | |
bool OnLoadGraphics() | |
{ | |
cube.Create(displaySystem); | |
return true; | |
} | |
void OnResize(int w, int h) | |
{ | |
camera.Setup(w, h, null); | |
camera.Update(); | |
} | |
void OnRedraw(Surface surface) | |
{ | |
surface.Clear(depthBuffer); | |
display.SetCamera(surface, camera); | |
display.DrawObject(cube); | |
} | |
} | |
Min3D min3D {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimal!