Skip to content

Instantly share code, notes, and snippets.

@jerstlouis
Last active April 29, 2016 16:43
Show Gist options
  • Save jerstlouis/d7369a2df831ffcc2e1fc8617774d14c to your computer and use it in GitHub Desktop.
Save jerstlouis/d7369a2df831ffcc2e1fc8617774d14c to your computer and use it in GitHub Desktop.
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 {};
Copy link

ghost commented Apr 29, 2016

Minimal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment