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;
82 GLenum indexType = GL_INVALID_ENUM;
83 GLsizei indexCount = 0;
84 GLsizei indexStride = 0;
101 uint8_t activeAttributes = 0;
102 uint8_t activeTextureUnits = 0;
103 SemanticSlot attributeSemantic[OpenGLES30::maxVertexAttributes];
104 GLint attributeLocation[OpenGLES30::maxVertexAttributes];
118 BlendState::BlendOperation color = BlendState::BlendOperation::Add;
119 BlendState::BlendOperation alpha = BlendState::BlendOperation::Add;
125#if defined COGS_OPENGL20 || defined COGS_OPENGLES30
126extern const char* getErrorString(GLint errorCode);
127extern void logGLString(
const char* name, GLenum key);
128extern void checkGLError(
const char* operation);
135#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 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).