20 #include "../basic_types.h"
21 #include "../exception.h"
25 class GraphicPipeline;
38 friend class ::Beatmup::GraphicPipeline;
110 return format == TextureFormat::Rx32f ||
format == TextureFormat::RGBx32f ||
format == TextureFormat::RGBAx32f;
131 Exception(
"Input texture format is not supported: %s", GL::TextureHandler::textureFormatToString(
format))
Base class for all exceptions.
Stores references to GPU resources that will not be used anymore and needed to be recycled in a threa...
virtual const int getDepth() const =0
Depth of the texture in pixels.
const bool isFloatingPoint() const
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 const int getHeight() const =0
Height of the texture in pixels.
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.
float getInvAspectRatio() const
Inverse of the aspect ratio of the texture.
float getAspectRatio() const
Aspect ratio of the texture.
virtual const int getWidth() const =0
Width of the texture in pixels.
Internal low-level GPU control API.
Beatmup object base class
Exception thrown when texture format does not match any supported format.
UnsupportedTextureFormat(const GL::TextureHandler::TextureFormat &format)
unsigned int handle_t
A reference to a GPU resource.
TextureParam
Parameters of binding a texture to a texture unit on GPU.
@ INTERP_LINEAR
bilinear pixel interpolation
@ INTERP_NEAREST
nearest neighbor pixel interpolation
@ REPEAT
wrapping the texture by repeating instead of clamping to edge
JNIEnv jobject jint format