graphics

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 474dc21f6f628f90fc93b1059b8d44b2f0cc9634
parent 7511c235b33067fc3f9ed8b0f62e88268a8a98ff
Author: Brian Swetland <swetland@frotz.net>
Date:   Mon,  9 Sep 2013 03:51:11 -0700

hello: toggle fullscreen on ENTER

Diffstat:
Mhello/hello.cc | 15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hello/hello.cc b/hello/hello.cc @@ -47,6 +47,7 @@ public: void release(void); void build(void); void onKeyUp(unsigned code); + void onResize(void); private: float t; @@ -124,8 +125,6 @@ int TestApp::init(void) { vbuf.load(m->vdata, 32 * m->vcount); ibuf.load(m->idx, 2 * m->icount); - proj.setPerspective(D2R(50.0), width / (float) height, 0.1f, 250.0f); - build(); zoom = SZ; @@ -135,14 +134,20 @@ int TestApp::init(void) { if (text.init(this, width/16, height/16)) return -1; + onResize(); + return 0; } +void TestApp::onResize(void) { + proj.setPerspective(D2R(50.0), width / (float) height, 0.1f, 250.0f); +} + static float rate = 90.0; void TestApp::onKeyUp(unsigned code) { switch (code) { - case SDL_SCANCODE_P: + case SDL_SCANCODE_P: { Effect *e2 = Effect::load("simple"); if (e2) { delete e; @@ -150,6 +155,10 @@ void TestApp::onKeyUp(unsigned code) { } break; } + case SDL_SCANCODE_RETURN: + fullscreen(!isFullscreen()); + break; + } } void TestApp::render(void) {