3#include "../BaseGL/GLFuncPointers.h"
6#include <OpenGLES/ES2/gl.h>
9#ifdef __native_client__
17#include "../Base/ResourceMap.h"
18#include "../VertexFormat.h"
21#include <OsoMemoryProfiler/CogsMemoryProfile.h>
23#include "../BlendState.h"
25#include "Foundation/Logging/Logger.h"
26#include "Foundation/Memory/MemoryBuffer.h"
33 constexpr size_t maxTexUnits = 32;
34 constexpr size_t maxVertexAttributes = 32;
35 constexpr size_t maxUniformBuffers = 32;
37 enum struct BufferTarget : uint8_t
45 TransformFeedbackBuffer,
49 const char* framebuffersStatusString(GLenum status);
55 size_t numFormats = 0;
83 GLenum indexType = GL_INVALID_ENUM;
84 GLsizei indexCount = 0;
85 GLsizei indexStride = 0;
102 uint8_t activeAttributes = 0;
103 uint8_t activeTextureUnits = 0;
104 SemanticSlot attributeSemantic[OpenGLES30::maxVertexAttributes];
105 GLint attributeLocation[OpenGLES30::maxVertexAttributes];
122 BlendState::BlendOperation color = BlendState::BlendOperation::Add;
123 BlendState::BlendOperation alpha = BlendState::BlendOperation::Add;
129#if defined COGS_OPENGL20 || defined COGS_OPENGLES30
130extern const char* getErrorString(GLint errorCode);
131extern void logGLString(
const char* name, GLenum key);
132extern void checkGLError(
const char* operation);
139#define CHECKED(x) x; checkGLError(#x);
Contains all Cogs related functionality.
@ OpenGLES30
Graphics device using the OpenGLES 3.0 API.
Blend
Options for blend functions.
GLuint bufferId
OpenGL buffer name.
unsigned short isMapped
Buffer is currently mapped.
OpenGLES30::BufferTarget target
OpenGL bind target.
uint32_t bindFlags
Original Cogs::BindFlags bitmask used to create the buffer.
uint32_t size
Buffer size..
Memory::MemoryBuffer mappedData
Memory map backing store.
GLenum indexType
OpenGL index type if buffer is an index buffer.
unsigned short isIndexBuffer
Buffer is an index buffer.
const VertexFormat * vertexFormat
Vertex format if buffer is a vertex buffer.
unsigned short keepMapBacking
Do not release memory mapping backing store after unmap, set to 1 for repeatedly mapped buffers.
unsigned short writeBackMap
Set by map, if one, write back results to GL after unmap (i.e. map with write flags).
uint32_t readyAtFrame
Frame number at which the effect becomes ready, used to simulate asynchronous loading....