20 #include "../bitmap/converter.h"
21 #include "../bitmap/internal_bitmap.h"
32 #ifdef BEATMUP_GLES_ALLOW_DRM_FALLBACK
81 #ifdef BEATMUP_OPENGLVERSION_GLES
82 EGLDisplay eglDisplay;
86 EGLContext eglContext;
88 #ifdef BEATMUP_GLES_ALLOW_DRM_FALLBACK
95 #elif BEATMUP_PLATFORM_WINDOWS
117 #ifdef BEATMUP_OPENGLVERSION_GLES
119 if ((eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY)
123 if (!eglInitialize(eglDisplay, 0, 0)) {
125 #ifdef BEATMUP_GLES_ALLOW_DRM_FALLBACK
129 const char* DRI_DEVICE = std::getenv(
"BEATMUP_DRI_DEVICE");
130 static const char* DEFAULT_DRI_DEVICE =
"/dev/dri/card1";
131 DRM::Device device(DRI_DEVICE ? DRI_DEVICE : DEFAULT_DRI_DEVICE);
140 eglDisplay = eglGetDisplay(gbmDevice.
getPointer());
146 if (!eglInitialize(eglDisplay, 0, 0)) {
151 this->drmDevice = std::move(device);
152 this->drmConnector = std::move(connector);
153 this->drmCrtc = std::move(crtc);
154 this->gbmDevice = std::move(gbmDevice);
155 this->gbmSurface = std::move(gbmSurface);
157 auto err = eglGetError();
158 if (err == EGL_NOT_INITIALIZED)
166 eglBindAPI(EGL_OPENGL_ES_API);
169 static const int CONFIG_ATTRIBUTES_LEN = 5;
170 EGLint configAttributes[CONFIG_ATTRIBUTES_LEN] = {
171 #ifdef BEATMUP_OPENGLVERSION_GLES20
172 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
173 #elif defined BEATMUP_OPENGLVERSION_GLES31
174 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR,
176 EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
180 #ifdef BEATMUP_GLES_ALLOW_DRM_FALLBACK
183 configAttributes[CONFIG_ATTRIBUTES_LEN - 3] = EGL_NONE;
188 int totalConfigCount;
189 eglGetConfigs(eglDisplay,
nullptr, 0, &totalConfigCount);
190 std::vector<EGLConfig> configs;
191 configs.resize(totalConfigCount);
195 if (!eglChooseConfig(eglDisplay, configAttributes, configs.data(), totalConfigCount, &numConfigs))
199 #ifdef BEATMUP_GLES_ALLOW_DRM_FALLBACK
203 for (
int i = 0; i < totalConfigCount && !found; ++i) {
205 if (EGL_TRUE != eglGetConfigAttrib(eglDisplay, configs[i], EGL_RED_SIZE, &
val) ||
val != 8)
207 if (EGL_TRUE != eglGetConfigAttrib(eglDisplay, configs[i], EGL_GREEN_SIZE, &
val) ||
val != 8)
209 if (EGL_TRUE != eglGetConfigAttrib(eglDisplay, configs[i], EGL_BLUE_SIZE, &
val) ||
val != 8)
211 if (EGL_TRUE != eglGetConfigAttrib(eglDisplay, configs[i], EGL_ALPHA_SIZE, &
val) ||
val != 8)
213 eglConfig = configs[i];
217 throw GpuOperationError(
"EGL/DRM: no config matching the required surface format");
222 eglConfig = configs[0];
227 EGLint contextAttributes[] = {
228 EGL_CONTEXT_CLIENT_VERSION,
229 #ifdef BEATMUP_OPENGLVERSION_GLES20
231 #elif defined BEATMUP_OPENGLVERSION_GLES31
236 eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, contextAttributes);
237 if (eglContext == EGL_NO_CONTEXT)
242 eglDefaultSurface = eglSurface = EGL_NO_SURFACE;
243 #ifdef BEATMUP_GLES_ALLOW_DRM_FALLBACK
245 eglDefaultSurface = eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, gbmSurface.
getPointer(),
nullptr);
250 EGLint surfaceAttributes[] = {
256 eglDefaultSurface = eglSurface = eglCreatePbufferSurface(eglDisplay, eglConfig, surfaceAttributes);
259 if (eglSurface == EGL_NO_SURFACE)
260 throw GpuOperationError(
"EGL: window surface creation failed when init", eglGetError());
263 if (!eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext))
266 #ifdef BEATMUP_OPENGLVERSION_GLES20
272 #elif BEATMUP_PLATFORM_WINDOWS
273 PIXELFORMATDESCRIPTOR pfd;
274 memset(&pfd, 0,
sizeof(PIXELFORMATDESCRIPTOR));
275 pfd.nSize =
sizeof(PIXELFORMATDESCRIPTOR);
277 pfd.dwFlags = PFD_SUPPORT_OPENGL;
278 pfd.iPixelType = PFD_TYPE_RGBA;
281 pfd.iLayerType = PFD_MAIN_PLANE;
282 hwnd = CreateWindowEx(WS_EX_TOOLWINDOW,
288 WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
289 0, 0, 1, 1, 0, 0, GetModuleHandle(NULL), 0);
293 ShowWindow(hwnd, SW_HIDE);
294 HDC hdc = GetDC(hwnd);
297 hglrc = wglCreateContext(hdc);
298 wglMakeCurrent(hdc, hglrc);
299 if (!wglGetCurrentContext())
303 glewExperimental = GL_TRUE;
304 GLenum err = glewInit();
320 static int bootstapVisualAttrs[] = { GLX_RGBA, None };
321 XVisualInfo* vi = glXChooseVisual(
xDisplay, 0, bootstapVisualAttrs);
326 glewExperimental = GL_TRUE;
327 GLenum err = glewInit();
334 static int visualAttrs[] = {
335 GLX_DOUBLEBUFFER,
false,
340 visualAttrs, &numFbc);
345 static int pbufferAttrs[] = {
346 GLX_PBUFFER_WIDTH, 1,
347 GLX_PBUFFER_HEIGHT, 1,
354 vi = glXGetVisualFromFBConfig(
xDisplay, config[0]);
361 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &
glLimits.maxTextureImageUnits);
362 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &
glLimits.maxFragmentUniformVectors);
363 #ifndef BEATMUP_OPENGLVERSION_GLES20
364 glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0,
glLimits.maxWorkGroupCount + 0);
365 glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1,
glLimits.maxWorkGroupCount + 1);
366 glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2,
glLimits.maxWorkGroupCount + 2);
367 glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0,
glLimits.maxWorkGroupSize + 0);
368 glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1,
glLimits.maxWorkGroupSize + 1);
369 glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2,
glLimits.maxWorkGroupSize + 2);
370 glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &
glLimits.maxTotalWorkGroupSize);
371 glGetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, (GLint*)&
glLimits.maxSharedMemSize);
382 *vendor = (
char*)glGetString(GL_VENDOR),
383 *
renderer = (
char*)glGetString(GL_RENDERER),
384 *glslVersionStr = (
char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
385 BEATMUP_DEBUG_I(
"__________________________________________________________");
387 #ifndef BEATMUP_OPENGLVERSION_GLES20
394 BEATMUP_DEBUG_I(
"__________________________________________________________");
401 const char* FORCED_GLSL_VERSION = std::getenv(
"BEATMUP_GLSL_VERSION");
402 std::string versionStr(FORCED_GLSL_VERSION ? FORCED_GLSL_VERSION : (
const char*)glGetString(GL_SHADING_LANGUAGE_VERSION));
405 static const std::string ES_PREFIX =
"OpenGL ES GLSL ES ";
407 isGlEs = versionStr.substr(0, ES_PREFIX.length()) == ES_PREFIX;
409 versionStr = versionStr.substr(ES_PREFIX.length());
412 auto spacePos = versionStr.find(
" ");
413 if (spacePos == std::string::npos)
414 spacePos = versionStr.length();
415 versionStr = versionStr.substr(0, spacePos);
416 auto dotPos = versionStr.find(
".");
417 if (dotPos == std::string::npos)
418 throw GL::GLException(
"Cannot determine GLSL version from string '" + versionStr +
"'");
419 const int majVer = std::stoi(versionStr.substr(0, dotPos));
420 const int minVer = std::stoi(versionStr.substr(dotPos + 1));
441 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
445 glDisable(GL_DEPTH_TEST);
446 glDisable(GL_CULL_FACE);
447 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
448 glBlendColor(1.0f, 1.0f, 1.0f, 1.0f);
457 #ifdef BEATMUP_OPENGLVERSION_GLES
458 eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
459 if (eglSurface != EGL_NO_SURFACE && eglSurface != eglDefaultSurface)
460 eglDestroySurface(eglDisplay, eglSurface);
461 eglDestroySurface(eglDisplay, eglDefaultSurface);
462 eglDestroyContext(eglDisplay, eglContext);
463 eglTerminate(eglDisplay);
464 #elif BEATMUP_PLATFORM_WINDOWS
465 wglDeleteContext(hglrc);
479 #ifdef BEATMUP_PLATFORM_WINDOWS
481 #elif BEATMUP_PLATFORM_ANDROID
483 eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
484 if (eglSurface != EGL_NO_SURFACE && eglSurface != eglDefaultSurface)
485 eglDestroySurface(eglDisplay, eglSurface);
489 EGLint surfaceAttributes[] = {
490 EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
494 eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, (ANativeWindow*)data, surfaceAttributes);
495 if (eglSurface == EGL_NO_SURFACE)
496 throw GpuOperationError(
"EGL: window surface creation failed when switching display", eglGetError());
499 if (! eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext))
503 displayResolution.
set(ANativeWindow_getWidth((ANativeWindow*)data), ANativeWindow_getHeight((ANativeWindow*)data));
507 eglSurface = eglDefaultSurface;
508 if (! eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext))
514 glDisable(GL_DEPTH_TEST);
515 glDisable(GL_CULL_FACE);
517 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
518 glBlendColor(1.0f, 1.0f, 1.0f, 1.0f);
524 #ifdef BEATMUP_PLATFORM_WINDOWS
526 #elif BEATMUP_OPENGLVERSION_GLES
527 if (! eglSwapBuffers(eglDisplay, eglSurface))
541 #ifdef BEATMUP_OPENGLVERSION_GLES20
542 throw GL::Unsupported(
"Images binding is not supported in GL ES 2.0.");
548 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
549 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
552 glBindImageTexture(imageUnit,
554 0, texture.
getDepth() > 1 ? GL_TRUE : GL_FALSE, 0,
555 read &&
write ? GL_READ_WRITE : (
write ? GL_WRITE_ONLY : GL_READ_ONLY),
564 glActiveTexture(GL_TEXTURE0 + unit);
566 case GL::TextureHandler::TextureFormat::Rx8:
567 case GL::TextureHandler::TextureFormat::RGBx8:
568 case GL::TextureHandler::TextureFormat::RGBAx8:
571 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
572 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
575 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
576 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
580 case GL::TextureHandler::TextureFormat::Rx32f:
581 case GL::TextureHandler::TextureFormat::RGBx32f:
582 case GL::TextureHandler::TextureFormat::RGBAx32f:
584 #ifndef BEATMUP_OPENGLVERSION_GLES
586 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
587 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
590 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
591 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
595 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
596 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
600 case GL::TextureHandler::TextureFormat::OES_Ext:
606 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
607 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
610 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
611 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
624 glClear(GL_COLOR_BUFFER_BIT);
638 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
640 GLuint err = glCheckFramebufferStatus(GL_FRAMEBUFFER);
641 if (err != GL_FRAMEBUFFER_COMPLETE)
648 glBindFramebuffer(GL_FRAMEBUFFER, 0);
650 glClear(GL_COLOR_BUFFER_BIT);
663 DebugAssertion::check(
bitmap.
getData(0, 0) !=
nullptr,
"Cannot pull pixels: the bitmap is not locked");
666 #ifdef BEATMUP_OPENGLVERSION_GLES20
668 throw GL::Unsupported(
"Floating point valued bitmaps are not updatable from GPU memory");
674 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
bitmap.
textureHandle, 0);
677 glPixelStorei(GL_PACK_ALIGNMENT, 1);
679 bool buffered =
false;
680 #ifdef BEATMUP_OPENGLVERSION_GLES20
684 glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &
format);
685 glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &type);
735 DebugAssertion::check(
bitmap.
getData(0, 0) !=
nullptr,
"Cannot push pixels: the bitmap is not locked");
739 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
745 #ifdef BEATMUP_OPENGLVERSION_GLES20
746 glTexImage2D(GL_TEXTURE_2D,
749 0, GL_ALPHA, GL_UNSIGNED_BYTE,
752 glTexSubImage2D(GL_TEXTURE_2D,
762 #ifdef BEATMUP_OPENGLVERSION_GLES20
763 glTexImage2D(GL_TEXTURE_2D,
772 glTexSubImage2D(GL_TEXTURE_2D,
807 glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
810 glClearColor(0, 0, 0, 0);
826 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
844 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
882 impl->
bind(texture, texUnit, param);
947 return (
const char*)glGetString(GL_VENDOR);
952 return (
const char*)glGetString(GL_RENDERER);
988 dx = sampling.
x > 1 ? 0.5f * area.
width() / (sampling.
x - 1) : 0.0f,
989 dy = sampling.
y > 1 ? 0.5f * area.
height() / (sampling.
y - 1) : 0.0f;
993 (area.
a.
x + 0.5f - dx) /
size.x,
994 (area.
a.
y + 0.5f - dy) /
size.y,
995 (area.
b.
x + 0.5f + dx) /
size.x,
996 (area.
b.
y + 0.5f + dy) /
size.y
Makes a bitmap writable for a specific target device.
A very basic class for any image.
virtual const TextureFormat getTextureFormat() const
Returns the texture format specifying how the shader must interpret the data.
Context & getContext() const
const ImageResolution getSize() const
Returns the bitmap resolution within ImageResolution object.
virtual void prepare(GraphicPipeline &gpu)
Prepares (eventually uploads) texture data on GPU.
const unsigned char getBitsPerPixel() const
Returns number of bits per pixel stored in each bitmap.
bool isMask() const
Returns true if the bitmap is a mask, false otherwise.
bool isFloat() const
Returns true if the bitmap contains floating point values, false otherwise.
bool upToDate[2]
bitmap up-to-date state on CPU and GPU
struct gbm_device * getPointer()
struct gbm_surface * getPointer()
Base class for all exceptions.
static void check(const std::string &info)
Handles a collection of common rendering programs of predefined types and shared operations among the...
virtual const int getDepth() const =0
Depth of the texture in pixels.
virtual const int getHeight() const =0
Height of the texture in pixels.
virtual void prepare(GraphicPipeline &gpu)
Prepares (eventually uploads) texture data on GPU.
virtual const TextureFormat getTextureFormat() const =0
Returns the texture format specifying how the shader must interpret the data.
virtual const int getWidth() const =0
Width of the texture in pixels.
Exception communicating the use of an unsupported feature on GPU.
GpuOperationError(const char *info)
GpuOperationError(const char *info, int code)
Internal low-level GPU control API.
static Rectangle getTextureCoordinates(const Rectangle &area, const IntPoint &size, const IntPoint &sampling)
Computes floating-point texture coordinates for pixel-accurate sampling: a texture gets sampled exact...
void switchMode(Mode mode)
Switches GPU mode.
const char * getGpuRendererString() const
const ImageResolution & getDisplayResolution() const
int getLimit(Limit limit) const
void pullPixels(AbstractBitmap &bitmap)
Transfers bitmap pixels from GPU to CPU.
int getGlslVersion() const
Returns GLSL language version supported by the GPU context being used.
const char * getGpuVendorString() const
void pushPixels(AbstractBitmap &bitmap)
Transfers bitmap pixels from CPU to GPU.
void bindOutput(AbstractBitmap &bitmap)
Binds a bitmap to the pipeline output.
Mode
Graphic pipeline working mode setting some common OpenGL switches.
@ RENDERING
Textures are images to be blended together to produce another image.
@ INFERENCE
Textures are feature maps computed in fragment shaders.
void setTextureCoordinates(const Rectangle &coords)
Specifies texture coordinates for the next rendering pass.
void switchDisplay(void *data)
Limit
GPU characteristics.
@ TEXTURE_IMAGE_UNITS
maximum number of texture units per fragment shader
@ FRAGMENT_UNIFORM_VECTORS
maximum number of 4-dimensional uniform vectors per fragment shader
static const int ATTRIB_TEXTURE_COORD
texture coordinate attribute index in the VBO
GL::RenderingPrograms * renderingPrograms
void flush()
Waits until all operations submitted to GPU are finished.
void bind(GL::TextureHandler &texture, size_t texUnit, const TextureParam param)
void unbindOutput()
Unbinds a bitmap from output and switches to screen.
static const int ATTRIB_VERTEX_COORD
vertex coordinate attribute index in the VBO
bool isGlEsCompliant() const
Returns true if the GPU context is OpenGL ES-compliant.
Represents image size in pixels.
unsigned int getWidth() const
void set(unsigned int width, unsigned int height)
IntRectangle halfOpenedRectangle() const
unsigned int getHeight() const
Bitmap whose memory is managed by the Beatmup engine.
const pixbyte * getData(int x, int y) const
Returns a pointer to given pixel.
const int getHeight() const
Height of the texture in pixels.
const int getWidth() const
Width of the texture in pixels.
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
void bindOutput(GL::handle_t texture)
bool isGlEsCompliant() const
void bindImage(GL::TextureHandler &texture, int imageUnit, bool read, bool write)
Binds a texture handle to an image unit.
void bindOutput(GL::TextureHandler &textureHandler)
bool isGlEs
if true, the use OpenGL context is GL ES-compliant
Impl(GraphicPipeline &front)
void bind(GL::TextureHandler &texture, size_t unit, const TextureParam param)
int getLimit(GraphicPipeline::Limit limit) const
bool isRectangularTextureCoordinates
if true, the texture coordinates is a rectangle
void pullPixels(AbstractBitmap &bitmap)
Transfers texture data from GPU to CPU.
void switchMode(GraphicPipeline::Mode mode)
void setTextureCoordinates(const Rectangle &coords)
void setTextureCoordinates(const Point &leftTop, const Point &rightTop, const Point &leftBottom, const Point &rightBottom)
GLuint hVertexAttribBuffer
buffer used when rendering
VertexAttribBufferElement vertexAttribBuffer[4]
ImageResolution displayResolution
width and height of a display obtained when switching
int maxTotalWorkGroupSize
struct GraphicPipeline::Impl::@15 glLimits
int getGlslVersion() const
int glslVersion
GLSL language version to put into shaders code, e.g. 100 for 1.00.
void pushPixels(AbstractBitmap &bitmap)
Transfers texture data from CPU to GPU.
const ImageResolution & getDisplayResolution() const
int getSharedMemSize() const
void bindOutput(AbstractBitmap &bitmap, const IntRectangle &viewport)
int maxFragmentUniformVectors
void switchDisplay(void *data)
Platform-dependent display switching routine.
#define BEATMUP_DEBUG_I(...)
void write(Bitmap &bitmap, Args &&... args)
Calls a Func< WriterClass >::process(access, params) that writes to a bitmap of any kind,...
void read(Bitmap &bitmap, Args &&... args)
Calls a Func< ReaderClass >::process(access, params), where.
const GLuint TEXTUREHANDLER_INTERNALFORMATS[]
const GLuint BITMAP_INTERNALFORMATS[]
const GLuint BITMAP_PIXELTYPES[]
Mapping of bitmap pixel formats to GL pixel types.
const GLuint BITMAP_PIXELFORMATS[]
Mapping of bitmap pixel formats to GL pixel formats.
unsigned int handle_t
A reference to a GPU resource.
uint32_t msize
memory size
@ QuadFloat
4 channels of 32 bits per pixel, single precision floating point values,
@ QuadByte
4 channels of 8 bits per pixel (like RGBA), unsigned integer values
CustomRectangle< float > Rectangle
TextureParam
Parameters of binding a texture to a texture unit on GPU.
@ INTERP_LINEAR
bilinear pixel interpolation
@ REPEAT
wrapping the texture by repeating instead of clamping to edge
Vertex attribute buffer entry: vertex coordinates (x,y) and texture coordinates (s,...
JNIEnv jobject jint format
jlong jint jint jint jint pixelFormat
jobject jlong jint jint y
return(jlong) new Beatmup jlong jstring jint val
Beatmup::InternalBitmap * bitmap
JNIEnv jlong jfloat jfloat s
Beatmup::SceneRenderer * renderer