Changeset View
Changeset View
Standalone View
Standalone View
source/lib/res/graphics/ogl_tex.cpp
Show All 23 Lines | |||||
#include "ogl_tex.h" | #include "ogl_tex.h" | ||||
#include "lib/app_hooks.h" | #include "lib/app_hooks.h" | ||||
#include "lib/bits.h" | #include "lib/bits.h" | ||||
#include "lib/ogl.h" | #include "lib/ogl.h" | ||||
#include "lib/res/h_mgr.h" | #include "lib/res/h_mgr.h" | ||||
#include "lib/tex/tex.h" | #include "lib/tex/tex.h" | ||||
#include <cstdio> | #include <cstdio> | ||||
vladislavbelov: Is it needed? | |||||
//---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
// OpenGL helper routines | // OpenGL helper routines | ||||
//---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
static bool filter_valid(GLint filter) | static bool filter_valid(GLint filter) | ||||
{ | { | ||||
switch(filter) | switch(filter) | ||||
▲ Show 20 Lines • Show All 425 Lines • ▼ Show 20 Lines | static Status OglTex_reload(OglTex* ot, const PIVFS& vfs, const VfsPath& pathname, Handle h) | ||||
glGenTextures(1, &ot->id); | glGenTextures(1, &ot->id); | ||||
// if it had already been uploaded before this reload, | // if it had already been uploaded before this reload, | ||||
// re-upload it (this also does state_latch). | // re-upload it (this also does state_latch). | ||||
if(ot->flags & OT_NEED_AUTO_UPLOAD) | if(ot->flags & OT_NEED_AUTO_UPLOAD) | ||||
(void)ogl_tex_upload(h); | (void)ogl_tex_upload(h); | ||||
#if KHR_DEBUG_ENABLED | |||||
const std::string name = pathname.string8(); | |||||
glBindTexture(GL_TEXTURE_2D, ot->id); | |||||
Not Done Inline Actionsconst. vladislavbelov: `const`. | |||||
glObjectLabel(GL_TEXTURE, ot->id, name.size(), name.c_str()); | |||||
#endif | |||||
return INFO::OK; | return INFO::OK; | ||||
} | } | ||||
static Status OglTex_validate(const OglTex* ot) | static Status OglTex_validate(const OglTex* ot) | ||||
{ | { | ||||
if(ot->flags & OT_TEX_VALID) | if(ot->flags & OT_TEX_VALID) | ||||
{ | { | ||||
RETURN_STATUS_IF_ERR(ot->t.validate()); | RETURN_STATUS_IF_ERR(ot->t.validate()); | ||||
▲ Show 20 Lines • Show All 619 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Is it needed?