#include <boost/bind.hpp>
+#include "math.hh"
#include "opengl.hh"
-#include "video.hh"
#include "settings.hh"
-
-#include "math.hh"
+#include "timer.hh"
+#include "video.hh"
#include "YoinkApp.hh"
-#include "timer.hh"
-
#if HAVE_CONFIG_H
#include "config.h"
#endif
{
std::string files;
- char* configFile = getenv("YOINK_CONFIGFILE");
+ char* configFile = getenv("YOINKRC");
if (configFile)
{
// if a config file from the environment variable is specified, we want
- // to load it first
+ // to load it first so it has precedence
files += configFile;
files += ":";
}
glClearColor(0.0, 0.0, 1.0, 1.0);
- glLineWidth(10.0f);
+ //glLineWidth(10.0f);
}
void YoinkApp::contextRecreated(const dc::notification& note)
void YoinkApp::draw(dc::scalar alpha)
{
- dc::vector4 meh;
- meh.random(0.0, 1.0);
- static dc::vector4 c1(meh);
+ //dc::vector4 meh;
+ //meh.random(0.0, 1.0);
+ //static dc::vector4 c1(meh);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- dc::scalar drawstate = cml::lerp(prevstate, state, alpha);
- dc::scalar sinstate = std::sin(drawstate);
- dc::scalar cosstate = std::cos(drawstate);
+ //dc::scalar drawstate = cml::lerp(prevstate, state, alpha);
+ //dc::scalar sinstate = std::sin(drawstate);
+ //dc::scalar cosstate = std::cos(drawstate);
+
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(60.0, 1.33333, 1.0, 2000.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glBindTexture(GL_TEXTURE_2D, 0);
+ //glRotatef(drawstate*15.0f, 0.0, 1.0, 0.0);
+ glTranslatef(x, y, z);
// DRAW THE SCENE
testScene->draw(alpha);
+ /*
someChar->getTilemap().bind();
glColor3f(1.0, 1.0, 1.0);
glRectf(-1.0f, -1.0f, 1.0f, 1.0f);
glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
+ glEnable(GL_DEPTH_TEST);*/
}
void YoinkApp::handleEvent(const dc::event& e)
{
someChar->getAnimation().startSequence("Punch");
}
+ else if (e.key.keysym.sym == SDLK_RIGHT)
+ {
+ x -= 50.0;
+ }
+ else if (e.key.keysym.sym == SDLK_LEFT)
+ {
+ x += 50.0;
+ }
+ else if (e.key.keysym.sym == SDLK_UP)
+ {
+ y -= 50.0;
+ }
+ else if (e.key.keysym.sym == SDLK_DOWN)
+ {
+ y += 50.0;
+ }
+ else if (e.key.keysym.sym == SDLK_PAGEUP)
+ {
+ z += 50.0;
+ }
+ else if (e.key.keysym.sym == SDLK_PAGEDOWN)
+ {
+ z -= 50.0;
+ }
break;
case SDL_QUIT: