--- /dev/null
+extension ARB_shadow
</command>
</commands>
+ <enums>
+ <!-- These error codes weren't promoted to core with the rest of
+ EXT_framebuffer_object. There's no harm in taking them in since
+ they're not passed to GL at any point. -->
+ <enum value="0x8CD9" name="GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS"/>
+ <enum value="0x8CDA" name="GL_FRAMEBUFFER_INCOMPLETE_FORMATS"/>
+ </enums>
+
+ <feature api="gl" name="MSPGL">
+ <require>
+ <enum name="GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS" />
+ <enum name="GL_FRAMEBUFFER_INCOMPLETE_FORMATS" />
+ </require>
+ </feature>
+
<feature api="gl" name="MSPGL_REMOVE">
<remove>
<!-- These have no counterparts in the core version of
ARB_shader_objects. -->
<command name="glGetHandleARB" />
<command name="glGetObjectParameterfvARB" />
+ <enum name="GL_PROGRAM_OBJECT_ARB" />
+ <enum name="GL_SHADER_OBJECT_ARB" />
+ <enum name="GL_OBJECT_TYPE_ARB" />
<!-- Ignore this, as it comes from ARB_vertex_program and I'm not
sure if it works with ARB_shader_objects. -->
</feature>
<extensions>
- <extension name="GL_ARB_uniform_buffer_object" supported="gl">
+ <!-- Some functions mentioned in GL_ARB_uniform_buffer_object
+ specification are missing from gl.xml. -->
+ <extension name="GL_ARB_uniform_buffer_object" supported="gl|glcore">
<require>
<command name="glBindBufferRange" />
<command name="glBindBufferBase" />
#include <stdexcept>
-#include <msp/gl/extensions/arb_pixel_buffer_object.h>
-#include <msp/gl/extensions/arb_uniform_buffer_object.h>
-#include <msp/gl/extensions/arb_vertex_buffer_object.h>
#include "buffer.h"
#include "error.h"
#include "mesh.h"
#include <vector>
#include "gl.h"
+#include <msp/gl/extensions/arb_pixel_buffer_object.h>
#include <msp/gl/extensions/arb_vertex_buffer_object.h>
#include <msp/gl/extensions/arb_uniform_buffer_object.h>
{
FRAMEBUFFER_INCOMPLETE_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT,
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT,
- FRAMEBUFFER_INCOMPLETE_DIMENSIONS = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT,
- FRAMEBUFFER_INCOMPLETE_FORMATS = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT,
+ FRAMEBUFFER_INCOMPLETE_DIMENSIONS = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS,
+ FRAMEBUFFER_INCOMPLETE_FORMATS = GL_FRAMEBUFFER_INCOMPLETE_FORMATS,
FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER,
FRAMEBUFFER_INCOMPLETE_READ_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER,
FRAMEBUFFER_UNSUPPORTED = GL_FRAMEBUFFER_UNSUPPORTED,
RGB = GL_RGB,
RGBA = GL_RGBA,
RGB8 = GL_RGB8,
- RGB16F = GL_RGB16F_ARB,
- RGB32F = GL_RGB32F_ARB,
+ RGB16F = GL_RGB16F,
+ RGB32F = GL_RGB32F,
RGBA8 = GL_RGBA8,
- RGBA16F = GL_RGBA16F_ARB,
- RGBA32F = GL_RGBA32F_ARB,
- SRGB = GL_SRGB_EXT,
- SRGB_ALPHA = GL_SRGB_ALPHA_EXT,
- SRGB8 = GL_SRGB8_EXT,
- SRGB8_ALPHA8 = GL_SRGB8_ALPHA8_EXT,
+ RGBA16F = GL_RGBA16F,
+ RGBA32F = GL_RGBA32F,
+ SRGB = GL_SRGB,
+ SRGB_ALPHA = GL_SRGB_ALPHA,
+ SRGB8 = GL_SRGB8,
+ SRGB8_ALPHA8 = GL_SRGB8_ALPHA8,
BGR = GL_BGR,
BGRA = GL_BGRA,
LUMINANCE = GL_LUMINANCE,
LUMINANCE8 = GL_LUMINANCE8,
+ // TODO Remove LUMINANCE(_ALPHA) float formats once ARB_texture_rg becomes supported
LUMINANCE16F = GL_LUMINANCE16F_ARB,
LUMINANCE32F = GL_LUMINANCE32F_ARB,
LUMINANCE_ALPHA = GL_LUMINANCE_ALPHA,
LUMINANCE_ALPHA8 = GL_LUMINANCE8_ALPHA8,
LUMINANCE_ALPHA16F = GL_LUMINANCE_ALPHA16F_ARB,
LUMINANCE_ALPHA32F = GL_LUMINANCE_ALPHA32F_ARB,
- SLUMINANCE = GL_SLUMINANCE_EXT,
- SLUMINANCE8 = GL_SLUMINANCE8_EXT,
- SLUMINANCE_ALPHA = GL_SLUMINANCE_ALPHA_EXT,
- SLUMINANCE8_ALPHA8 = GL_SLUMINANCE8_ALPHA8_EXT
+ SLUMINANCE = GL_SLUMINANCE,
+ SLUMINANCE8 = GL_SLUMINANCE8,
+ SLUMINANCE_ALPHA = GL_SLUMINANCE_ALPHA,
+ SLUMINANCE8_ALPHA8 = GL_SLUMINANCE8_ALPHA8
};
void operator>>(const LexicalConverter &, PixelFormat &);
#include <algorithm>
+#include <msp/gl/extensions/ext_texture3d.h>
#include "gl.h"
#include "pixelformat.h"
#include "pixelstore.h"
if(mask&SIZE)
{
glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, image_height);
+ if(EXT_texture3D)
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, image_height);
}
if(mask&ORIGIN)
{
glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels);
glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, skip_images);
+ if(EXT_texture3D)
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, skip_images);
}
if(mask&ALIGNMENT)
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
void PixelStore::set_origin(unsigned x, unsigned y, unsigned z)
{
+ if(z>0)
+ static Require _req3d(EXT_texture3D);
skip_pixels = x;
skip_rows = y;
skip_images = z;
+#include <msp/gl/extensions/arb_shadow.h>
+#include <msp/gl/extensions/ext_texture3d.h>
#include <msp/gl/extensions/ext_texture_filter_anisotropic.h>
#include <msp/gl/extensions/sgis_generate_mipmap.h>
#include <msp/strings/format.h>
if(mask&WRAP_R)
glTexParameteri(target, GL_TEXTURE_WRAP_R, wrap_r);
if(mask&GENERATE_MIPMAP)
- glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, gen_mipmap);
+ glTexParameteri(target, GL_GENERATE_MIPMAP, gen_mipmap);
if(mask&COMPARE)
glTexParameteri(target, GL_TEXTURE_COMPARE_MODE, (compare ? GL_COMPARE_R_TO_TEXTURE : GL_NONE));
if(mask&COMPARE_FUNC)
{
set_wrap_s(w);
set_wrap_t(w);
- set_wrap_r(w);
+ if(EXT_texture3D)
+ set_wrap_r(w);
}
void Texture::set_wrap_s(TextureWrap w)
void Texture::set_wrap_r(TextureWrap w)
{
+ static Require _req(EXT_texture3D);
wrap_r = w;
update_parameter(WRAP_R);
}
void Texture::set_compare_enabled(bool c)
{
+ static Require _req(ARB_shadow);
compare = c;
update_parameter(COMPARE);
}
void Texture::set_compare_func(Predicate f)
{
+ static Require _req(ARB_shadow);
cmp_func = f;
update_parameter(COMPARE_FUNC);
}