check that GL renderer defines make sense

This commit is contained in:
michael tesch 2016-06-07 21:24:10 +02:00
parent 3ccd635824
commit 334334a366
3 changed files with 52 additions and 1 deletions

View File

@ -10,6 +10,14 @@
#if defined(TB_RENDERER_GL)
#if defined(TB_RENDERER_GLES_1) && defined(TB_RENDERER_GLES_2)
#error "Both GLES_1 and GLES_2 defined"
#elif defined(TB_RENDERER_GLES_1) && defined(TB_RENDERER_GL3)
#error "Both GLES_1 and GL3 defined"
#elif defined(TB_RENDERER_GLES_2) && defined(TB_RENDERER_GL3)
#error "Both GLES_2 and GL3 defined"
#endif
#ifdef TB_RENDERER_GLES_1
#include <EGL/egl.h>
#include <GLES/gl.h>

View File

@ -0,0 +1,43 @@
// ================================================================================
// == This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås ==
// == See tb_core.h for more information. ==
// ================================================================================
#include "tb_system.h"
#ifdef TB_CLIPBOARD_SDL2
#ifdef __EMSCRIPTEN__
#include "SDL/SDL.h"
#else
#include "SDL2/SDL.h"
#endif
namespace tb {
// == TBClipboard =====================================
void TBClipboard::Empty()
{
SetText("");
}
bool TBClipboard::HasText()
{
return SDL_HasClipboardText();
}
bool TBClipboard::SetText(const char *text)
{
return (0 == SDL_SetClipboardText(text));
}
bool TBClipboard::GetText(TBStr &text)
{
if (const char *str = GetClipboardText())
return text.Set(str);
}
} // namespace tb
#endif // TB_CLIPBOARD_SDL2

View File

@ -68,7 +68,7 @@
/** Enable renderer using OpenGL ES. This renderer depends on TB_RENDERER_GL.
It is using GL ES version 2. */
#define TB_RENDERER_GLES_2
//#define TB_RENDERER_GLES_2
/** The width of the font glyph cache. Must be a power of two. */
#define TB_GLYPH_CACHE_WIDTH 512