Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- /*
- Primary application class
- 3/11/2014
- SDLTutorials.com
- Tim Jones
- */
- //==============================================================================
- #ifndef __APP_H__
- #define __APP_H__
- #include "../openglinc.h"
- #include "../linkedList.h"
- #include "../Core/game.h"
- #include "../Core/Graphics/renderer.h"
- #include "input.h"
- #include "painter.h"
- #define SCREENW 640.0
- #define SCREENH 360.0
- #define WIDTH 32.0
- #define HEIGHT 24.0
- #define DEPTH 24.0
- namespace LIB {
- class App {
- protected:
- bool Running = true;
- bool Initialized = false;
- CORE::Game* game;
- Painter* painter;
- GLuint programID;
- GLuint terrainID;
- GLuint renderedTexture;
- GLuint MatrixID;
- unsigned cols = 10;
- unsigned rows = 10;
- unsigned numtiles = cols*rows;
- unsigned numplayers = 1;
- GLuint VertexVBOID;
- GLuint IndexVBOID;
- GLuint VertexPLAYERID;
- GLuint IndexPLAYERID;
- GLuint bufferID;
- sf::Clock clock;
- float camdir;
- float camdir_ang;
- float deltaTime;
- sf::RenderWindow window;
- static const int WindowWidth = CORE::Game::screenW;
- static const int WindowHeight = CORE::Game::screenH;
- public:
- sf::RenderWindow* get_window();
- // Initialize our SDL game / app
- bool Init();
- // Logic loop
- void Loop();
- // Capture Events
- void Input();
- // Test if game should close
- bool IsRunning();
- // Test if game should init
- bool IsInitialized();
- // Shutdown game
- void Terminate();
- // Render loop (draw)
- void Render();
- void Render(int ox, int oy);
- // Free up resources
- void Cleanup();
- protected:
- LIB::Input inp;
- double offsetX, offsetY;
- double x, y, w, h;
- int frame, frames, anim;
- int dir, dirs;
- double anim_sp, anim_n;
- double speed;
- double velX, velY;
- double accX[8], accY[8];
- double friX, friY;
- bool UP, DOWN, LEFT, RIGHT;
- public:
- App();
- ~App();
- void Execute(bool edit, sf::WindowHandle);
- // Move display here
- void SetCamera(int ox, int oy);
- public:
- static int GetWindowWidth();
- static int GetWindowHeight();
- };
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement