Create love.window, abstract SDL out of love.graphics

This commit is contained in:
Bart van Strien
2011-12-11 16:55:52 +01:00
parent 2b7da8ea27
commit 7c8fff979a
10 changed files with 543 additions and 194 deletions
+5 -13
View File
@@ -25,8 +25,7 @@
#include <iostream>
#include <cmath>
// SDL
#include <SDL.h>
// OpenGL
#include "GLee.h"
// LOVE
@@ -36,6 +35,8 @@
#include <image/Image.h>
#include <image/ImageData.h>
#include <window/Window.h>
#include "Font.h"
#include "Image.h"
#include "Quad.h"
@@ -51,15 +52,6 @@ namespace graphics
namespace opengl
{
struct DisplayMode
{
int width, height; // The size of the screen.
int colorDepth; // The color depth of the display mode.
bool fullscreen; // Fullscreen (true), or windowed (false).
bool vsync; // Vsync enabled (true), or disabled (false).
int fsaa; // 0 for no FSAA, otherwise 1, 2 or 4.
};
// During display mode changing, certain
// variables about the OpenGL context are
// lost.
@@ -114,7 +106,7 @@ namespace opengl
Font * currentFont;
Image::Filter currentImageFilter;
DisplayMode currentMode;
love::window::Window *currentWindow;
float lineWidth;
GLint matrixLimit;
@@ -161,7 +153,7 @@ namespace opengl
* @param vsync Pointer to a boolean for the vsync status.
* @param fsaa Pointer to an integer for the current number of full scene anti-aliasing buffers.
**/
void getMode(int * width, int * height, bool * fullscreen, bool * vsync, int * fsaa);
void getMode(int & width, int & height, bool & fullscreen, bool & vsync, int & fsaa);
/**
* Toggles fullscreen. Note that this also needs to reload the