20 #include "../basic_types.h"
21 #include "../gpu/pipeline.h"
22 #include "../gpu/bgl.h"
37 case GL::TextureHandler::TextureFormat::Rx8:
39 case GL::TextureHandler::TextureFormat::RGBx8:
41 case GL::TextureHandler::TextureFormat::RGBAx8:
44 case GL::TextureHandler::TextureFormat::Rx32f:
46 case GL::TextureHandler::TextureFormat::RGBx32f:
48 case GL::TextureHandler::TextureFormat::RGBAx32f:
52 return "OES extension";
54 return "invalid format";
65 BEATMUP_DEBUG_E(
"Destroying texture handler still having a valid handle");
78 case GL::TextureHandler::TextureFormat::Rx8:
79 case GL::TextureHandler::TextureFormat::Rx32f:
81 case GL::TextureHandler::TextureFormat::RGBx8:
82 case GL::TextureHandler::TextureFormat::RGBx32f:
84 case GL::TextureHandler::TextureFormat::RGBAx8:
85 case GL::TextureHandler::TextureFormat::RGBAx32f:
103 glDeleteTextures(1, &
handle);
A wrapper for a GPU resource.
Stores references to GPU resources that will not be used anymore and needed to be recycled in a threa...
void put(Item *item)
Puts an item into the recycle bin.
static const char * textureFormatToString(const TextureFormat &)
const int getNumberOfChannels() const
Returns number of channels containing in the texture.
bool hasValidHandle() const
Returns true if the texture handle points to a valid texture.
virtual void prepare(GraphicPipeline &gpu)
Prepares (eventually uploads) texture data on GPU.
TextureFormat
Texture format, specifies how the texture should be interpreted on the shader side.
@ OES_Ext
external EGL image
static const int TEXTURE_FORMAT_BYTES_PER_PIXEL[]
size of a texel in bytes for different texture formats
virtual const TextureFormat getTextureFormat() const =0
Returns the texture format specifying how the shader must interpret the data.
void invalidate(RecycleBin &)
Forces disposing the texture data, e.g.
Internal low-level GPU control API.
#define BEATMUP_DEBUG_E(...)
unsigned int handle_t
A reference to a GPU resource.
JNIEnv jobject jlong handle
JNIEnv jobject jint format