1
0
Fichiers

74 lignes
1.8 KiB
C
Brut Lien permanent Vue normale Historique

/*
* engine.h is initialy a file frome miniDart project
* Author : Eric Bachard / lundi 3 octobre 2016, 14:35:03 (UTC+0200)
* This file is under GPL v2 license
* See : http://www.gnu.org/licenses/gpl-2.0.html
*/
#ifndef __ENGINE_H
#define __ENGINE_H
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif
#ifndef GL3_PROTOTYPES
#define GL3_PROTOTYPES 1
#endif
#include <iostream>
#include <SDL3/SDL.h>
// TODO : implement OpenGL 4.x and more recent glsl versions
#define GLSL_VERSION_130 "#version 130"
class Engine
{
public:
Engine();
~Engine();
int init_SDL();
void sdl_application_abort(const char *);
void clean_and_close();
SDL_GLContext getGL_Context(){ return gl_context; }
void setGL_Context(SDL_GLContext aContext){ gl_context = aContext; }
SDL_Window * getWindow(){ return window; }
void setWindow(SDL_Window * aWindow){ window = aWindow; }
void getSystemDisplayDPI(int, float*, float*);
bool setApplicationDisplayDPI(float);
float getDpi() { return dpi; }
float getDefaultDpi() { return defaultDpi; }
SDL_DisplayMode current;
int getWidth(){ return mWidth; }
int getHeight(){ return mHeight; }
inline void setWidth( int dWidth ){ mWidth = dWidth; }
inline void setHeight(int dHeight ){ mHeight = dHeight; }
inline void setDpi(float new_dpi) { dpi = new_dpi; }
void set_glsl_version(char *);
const char * get_glsl_version() { return glsl_version; }
int displayIndex;
int DisplayNumber;
int windowDpiScaledWidth;
int windowDpiScaledHeight;
int windowDpiUnscaledWidth;
int windowDpiUnscaledHeight;
private:
const char * glsl_version;
SDL_GLContext gl_context;
SDL_Window * window;
float dpi;
float defaultDpi;
int mWidth;
int mHeight;
};
#endif /* __ENGINE_H */