OpenGL 2.1 is now required to use love.graphics (resolves issue #779.)

Removed love.graphics.isSupported("canvas", "shader", "npot", "subtractive", and "mipmap"), since those features are all guaranteed by the minimum system requirements.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2014-03-12 02:26:32 -03:00
parent a94637ef2b
commit caa61563cc
19 changed files with 247 additions and 559 deletions
+19
View File
@@ -74,6 +74,16 @@ bool Window::getConstant(Window::Setting in, const char *&out)
return settings.find(in, out);
}
bool Window::getConstant(const char *in, MessageBoxType &out)
{
return messageBoxTypes.find(in, out);
}
bool Window::getConstant(MessageBoxType in, const char *&out)
{
return messageBoxTypes.find(in, out);
}
StringMap<Window::Setting, Window::SETTING_MAX_ENUM>::Entry Window::settingEntries[] =
{
{"fullscreen", SETTING_FULLSCREEN},
@@ -100,5 +110,14 @@ StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM>::Entry Windo
StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM> Window::fullscreenTypes(Window::fullscreenTypeEntries, sizeof(Window::fullscreenTypeEntries));
StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM>::Entry Window::messageBoxTypeEntries[] =
{
{"error", MESSAGEBOX_ERROR},
{"warning", MESSAGEBOX_WARNING},
{"info", MESSAGEBOX_INFO},
};
StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM> Window::messageBoxTypes(Window::messageBoxTypeEntries, sizeof(Window::messageBoxTypeEntries));
} // window
} // love
+16
View File
@@ -39,6 +39,14 @@ namespace window
// whole thing here because it uses the Window::Type enum.
struct WindowSettings;
enum MessageBoxType
{
MESSAGEBOX_ERROR,
MESSAGEBOX_WARNING,
MESSAGEBOX_INFO,
MESSAGEBOX_MAX_ENUM
};
class Window : public Module
{
public:
@@ -119,6 +127,8 @@ public:
virtual const void *getHandle() const = 0;
virtual void showMessageBox(MessageBoxType type, const char *title, const char *message) = 0;
//virtual static Window *createSingleton() = 0;
//virtual static Window *getSingleton() = 0;
// No virtual statics, of course, but you are supposed to implement these statics.
@@ -129,6 +139,9 @@ public:
static bool getConstant(const char *in, FullscreenType &out);
static bool getConstant(FullscreenType in, const char *&out);
static bool getConstant(const char *in, MessageBoxType &out);
static bool getConstant(MessageBoxType in, const char *&out);
protected:
static Window *singleton;
@@ -141,6 +154,9 @@ private:
static StringMap<FullscreenType, FULLSCREEN_TYPE_MAX_ENUM>::Entry fullscreenTypeEntries[];
static StringMap<FullscreenType, FULLSCREEN_TYPE_MAX_ENUM> fullscreenTypes;
static StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM>::Entry messageBoxTypeEntries[];
static StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM> messageBoxTypes;
}; // Window
struct WindowSettings
+21
View File
@@ -654,6 +654,27 @@ const void *Window::getHandle() const
return window;
}
void Window::showMessageBox(MessageBoxType type, const char *title, const char *message)
{
SDL_MessageBoxFlags sdlflags;
switch (type)
{
case MESSAGEBOX_ERROR:
sdlflags = SDL_MESSAGEBOX_ERROR;
break;
case MESSAGEBOX_WARNING:
sdlflags = SDL_MESSAGEBOX_WARNING;
break;
case MESSAGEBOX_INFO:
default:
sdlflags = SDL_MESSAGEBOX_INFORMATION;
break;
}
SDL_ShowSimpleMessageBox(sdlflags, title, message, window);
}
love::window::Window *Window::createSingleton()
{
if (!singleton)
+2
View File
@@ -83,6 +83,8 @@ public:
const void *getHandle() const;
void showMessageBox(MessageBoxType type, const char *title, const char *message);
static love::window::Window *createSingleton();
static love::window::Window *getSingleton();