Heavy buffer update, window update, object tracking
This commit is contained in:
@@ -36,11 +36,22 @@ OpenGLError OpenGLError::status(const std::string& note) {
|
||||
return OpenGLError(glGetError(), note);
|
||||
}
|
||||
|
||||
const ConstantMap<TypeCodes, int> TypeToGLSL = {
|
||||
{TypeCodes::FLOAT16, GL_HALF_FLOAT},
|
||||
{TypeCodes::FLOAT32, GL_FLOAT},
|
||||
{TypeCodes::DOUBLE64, GL_DOUBLE},
|
||||
{TypeCodes::INT8, GL_BYTE},
|
||||
{TypeCodes::INT16, GL_SHORT},
|
||||
{TypeCodes::INT32, GL_INT},
|
||||
{TypeCodes::UINT8, GL_UNSIGNED_BYTE},
|
||||
{TypeCodes::UINT16, GL_UNSIGNED_SHORT},
|
||||
{TypeCodes::UINT32, GL_UNSIGNED_INT},
|
||||
};
|
||||
|
||||
// class OpenGLObject
|
||||
|
||||
void OpenGLObject::checkObjectContextValidity() {
|
||||
if (_arena != OGLWindow::getCurrentObjectArena()) {
|
||||
if (_arena != OGLWindow::GetCurrentObjectArena()) {
|
||||
THROW(OpenGLObjectError(OpenGLObjectError::INVALID_CONTEXT));
|
||||
}
|
||||
}
|
||||
@@ -50,7 +61,7 @@ OpenGLObject::OpenGLObject(OpenGLObject&& rval) : _arena(rval._arena) {
|
||||
*this = std::move(rval);
|
||||
}
|
||||
|
||||
OpenGLObject::OpenGLObject() : _arena(OGLWindow::getCurrentObjectArena()) {}
|
||||
OpenGLObject::OpenGLObject() : _arena(OGLWindow::GetCurrentObjectArena()) {}
|
||||
|
||||
OpenGLObject& OpenGLObject::operator=(OpenGLObject&& rhs) {
|
||||
rhs.checkObjectContextValidity();
|
||||
@@ -79,6 +90,10 @@ const GLEnumTableType GLenumTable = {
|
||||
GLENUMSTRPAIR(GL_RGB8UI),
|
||||
GLENUMSTRPAIR(GL_RGBA8UI),
|
||||
GLENUMSTRPAIR(GL_RGBA),
|
||||
GLENUMSTRPAIR(GL_ELEMENT_ARRAY_BUFFER),
|
||||
GLENUMSTRPAIR(GL_UNSIGNED_INT),
|
||||
GLENUMSTRPAIR(GL_UNSIGNED_SHORT),
|
||||
GLENUMSTRPAIR(GL_UNSIGNED_BYTE),
|
||||
};
|
||||
|
||||
} // namespace nb
|
||||
Reference in New Issue
Block a user