Merged default into minor

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-01-22 02:18:56 -04:00
11 changed files with 418 additions and 6 deletions
+10 -1
View File
@@ -593,7 +593,9 @@ bool Canvas::loadVolatile()
if (glGetError() != GL_NO_ERROR)
{
status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
gl.deleteTexture(texture);
texture = 0;
status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
return false;
}
@@ -617,7 +619,14 @@ bool Canvas::loadVolatile()
status = strategy->createFBO(fbo, texture);
if (status != GL_FRAMEBUFFER_COMPLETE)
{
if (fbo != 0)
{
strategy->deleteFBO(fbo, 0, 0);
fbo = 0;
}
return false;
}
clear(Color(0, 0, 0, 0));
+2
View File
@@ -50,6 +50,8 @@ Graphics::Graphics()
, created(false)
, writingToStencil(false)
{
gl = OpenGL();
states.reserve(10);
states.push_back(DisplayState());
+5
View File
@@ -218,6 +218,10 @@ void Shader::mapActiveUniforms()
bool Shader::loadVolatile()
{
// Recreating the shader program will invalidate uniforms that rely on these.
lastCanvas = (Canvas *) -1;
lastViewport = OpenGL::Viewport();
// zero out active texture list
activeTexUnits.clear();
activeTexUnits.insert(activeTexUnits.begin(), maxTexUnits, 0);
@@ -306,6 +310,7 @@ bool Shader::loadVolatile()
// make sure glUseProgram gets called.
current = nullptr;
attach();
checkSetScreenParams();
}
return true;
+6 -2
View File
@@ -43,6 +43,9 @@
#ifdef LOVE_ENABLE_ENET
# include "libraries/enet/lua-enet.h"
#endif
#ifdef LOVE_ENABLE_LUAUTF8
# include "libraries/luautf8/lutf8lib.h"
#endif
// Scripts
#include "scripts/boot.lua.h"
@@ -228,9 +231,7 @@ int luaopen_love(lua_State * L)
// Preload module loaders.
for (int i = 0; modules[i].name != 0; i++)
{
love::luax_preload(L, modules[i].func, modules[i].name);
}
#ifdef LOVE_ENABLE_LUASOCKET
love::luasocket::__open(L);
@@ -238,6 +239,9 @@ int luaopen_love(lua_State * L)
#ifdef LOVE_ENABLE_ENET
love::luax_preload(L, luaopen_enet, "enet");
#endif
#ifdef LOVE_ENABLE_LUAUTF8
love::luax_preload(L, luaopen_luautf8, "utf8");
#endif
return 1;
}
+9 -3
View File
@@ -52,12 +52,18 @@ Window::Window()
Window::~Window()
{
if (context)
{
graphics::Graphics *gfx = Module::getInstance<graphics::Graphics>(Module::M_GRAPHICS);
if (gfx != nullptr)
gfx->unSetMode();
SDL_GL_DeleteContext(context);
}
if (window)
SDL_DestroyWindow(window);
if (context)
SDL_GL_DeleteContext(context);
SDL_QuitSubSystem(SDL_INIT_VIDEO);
}