summaryrefslogtreecommitdiff
path: root/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application.cpp')
-rw-r--r--application.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/application.cpp b/application.cpp
index f7ddaae..15b68de 100644
--- a/application.cpp
+++ b/application.cpp
@@ -146,6 +146,7 @@ void Application::run() {
background = new TextureSDL("textures/background.png");
texture = new TextureSDL("textures/shot1.png");
shader = new GLShaderProgram();
+ player = new Player();
patterns.push_back(new BulletPattern());
for(int i = 0; i < 8; i++) {
@@ -191,6 +192,8 @@ void Application::main_loop(unsigned int tick, unsigned int step) {
for(std::vector<BulletPattern*>::iterator it = patterns.begin(); it < patterns.end(); it++) {
(*it)->update(elapsed, step);
}
+
+ player->update();
}
glClearColor(0, 0, 0, 0);
@@ -243,7 +246,7 @@ void Application::main_loop(unsigned int tick, unsigned int step) {
glClearColor(0.2, 0.2, 0.2, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
+
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, (float)660 / (float)740, 1, 100);
@@ -282,9 +285,12 @@ void Application::main_loop(unsigned int tick, unsigned int step) {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
-
+
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
+
+ player->draw();
+
shader->use();
glPointSize(32.0);
glEnable(GL_TEXTURE_2D);