Upgrade OpenGL backend to ES 3.0 (#995)

Co-authored-by: Tadej Novak <tadej@tano.si>
This commit is contained in:
mwilsnd
2023-04-13 16:24:45 -05:00
committed by GitHub
parent 569791b310
commit 4828cc7a8b
115 changed files with 760 additions and 1159 deletions

View File

@@ -542,76 +542,6 @@ PixelStoreUnpack::Type PixelStoreUnpack::Get() {
return value;
}
#if !MBGL_USE_GLES2
const constexpr PointSize::Type PointSize::Default;
void PointSize::Set(const Type& value) {
MBGL_CHECK_ERROR(glPointSize(value));
}
PointSize::Type PointSize::Get() {
GLfloat pointSize;
MBGL_CHECK_ERROR(glGetFloatv(GL_POINT_SIZE, &pointSize));
return pointSize;
}
const constexpr PixelZoom::Type PixelZoom::Default;
void PixelZoom::Set(const Type& value) {
MBGL_CHECK_ERROR(glPixelZoom(value.xfactor, value.yfactor));
}
PixelZoom::Type PixelZoom::Get() {
GLfloat xfactor;
GLfloat yfactor;
MBGL_CHECK_ERROR(glGetFloatv(GL_ZOOM_X, &xfactor));
MBGL_CHECK_ERROR(glGetFloatv(GL_ZOOM_Y, &yfactor));
return { xfactor, yfactor };
}
const constexpr RasterPos::Type RasterPos::Default;
void RasterPos::Set(const Type& value) {
MBGL_CHECK_ERROR(glRasterPos4d(value.x, value.y, value.z, value.w));
}
RasterPos::Type RasterPos::Get() {
GLdouble pos[4];
MBGL_CHECK_ERROR(glGetDoublev(GL_CURRENT_RASTER_POSITION, pos));
return { pos[0], pos[1], pos[2], pos[3] };
}
const constexpr PixelTransferDepth::Type PixelTransferDepth::Default;
void PixelTransferDepth::Set(const Type& value) {
MBGL_CHECK_ERROR(glPixelTransferf(GL_DEPTH_SCALE, value.scale));
MBGL_CHECK_ERROR(glPixelTransferf(GL_DEPTH_BIAS, value.bias));
}
PixelTransferDepth::Type PixelTransferDepth::Get() {
Type value;
MBGL_CHECK_ERROR(glGetFloatv(GL_DEPTH_SCALE, &value.scale));
MBGL_CHECK_ERROR(glGetFloatv(GL_DEPTH_BIAS, &value.bias));
return value;
}
const constexpr PixelTransferStencil::Type PixelTransferStencil::Default;
void PixelTransferStencil::Set(const Type& value) {
MBGL_CHECK_ERROR(glPixelTransferf(GL_INDEX_SHIFT, value.shift));
MBGL_CHECK_ERROR(glPixelTransferf(GL_INDEX_OFFSET, value.offset));
}
PixelTransferStencil::Type PixelTransferStencil::Get() {
Type value;
MBGL_CHECK_ERROR(glGetIntegerv(GL_INDEX_SHIFT, &value.shift));
MBGL_CHECK_ERROR(glGetIntegerv(GL_INDEX_OFFSET, &value.offset));
return value;
}
#endif // MBGL_USE_GLES2
} // namespace value
} // namespace gl
} // namespace mbgl