Fix two Emscripten/GLES compile issues.

This commit is contained in:
Kai Blaschke
2023-07-24 11:29:12 +02:00
committed by Kai Blaschke
parent b07163dd51
commit a294b8a374
2 changed files with 9 additions and 0 deletions

View File

@ -201,7 +201,11 @@ void Framebuffer::MaskDrawBuffer(int bufferIndex, bool masked)
{
// Invert the flag, as "true" means the color channel *will* be written.
auto glMasked = static_cast<GLboolean>(!masked);
#if USE_GLES
glColorMask(glMasked, glMasked, glMasked, glMasked);
#else
glColorMaski(bufferIndex, glMasked, glMasked, glMasked, glMasked);
#endif
}
void Framebuffer::UpdateDrawBuffers(int framebufferIndex)

View File

@ -1,5 +1,10 @@
#include "TextureAttachment.hpp"
// OpenGL ES might not define this constant in its headers, e.g. in the iOS and Emscripten SDKs.
#ifndef GL_STENCIL_INDEX
#define GL_STENCIL_INDEX 0x1901
#endif
TextureAttachment::TextureAttachment(AttachmentType attachment, int width, int height)
: m_attachmentType(attachment)
{