#include "renderable.h"
#include "renderer.h"
#include "resourcemanager.h"
+#include "resources.h"
#include "sampler.h"
#include "texture.h"
#include "vertexarray.h"
namespace Msp {
namespace GL {
-Renderer::Renderer()
+Renderer::Renderer():
+ placeholder_texture(Resources::get_global().get<Texture>("_placeholder.png"))
{
state_stack.reserve(16);
shdata_stack.reserve(32);
State &state = get_state();
if(tex)
+ {
if(ResourceManager *res_mgr = tex->get_manager())
res_mgr->resource_used(*tex);
+ if(!tex->is_loaded())
+ tex = &placeholder_texture;
+ }
if(texture_stack.size()>state.texture_count)
{
ProgramData standard_shdata;
std::vector<BoundProgramData> shdata_stack;
std::vector<BoundTexture> texture_stack;
+ const Texture &placeholder_texture;
Commands commands;
public: