mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ Graphics::Graphics()
|
||||
, created(false)
|
||||
, writingToStencil(false)
|
||||
{
|
||||
gl = OpenGL();
|
||||
|
||||
states.reserve(10);
|
||||
states.push_back(DisplayState());
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user