private:
PrimitiveType prim_type;
- GLenum gl_prim_type;
+ unsigned gl_prim_type;
DataType index_type;
- GLenum gl_index_type;
+ unsigned gl_index_type;
std::vector<std::uint8_t> data;
unsigned max_index;
~Batch();
PrimitiveType get_type() const { return prim_type; }
- GLenum get_gl_primitive_type() const { return gl_prim_type; }
+ unsigned get_gl_primitive_type() const { return gl_prim_type; }
void set_index_type(DataType);
DataType get_index_type() const { return index_type; }
- GLenum get_gl_index_type() const { return gl_index_type; }
+ unsigned get_gl_index_type() const { return gl_index_type; }
Batch &append(unsigned);
Batch &append(const std::vector<unsigned> &);
}
-GLenum get_gl_blend_equation(BlendEquation eq)
+unsigned get_gl_blend_equation(BlendEquation eq)
{
switch(eq)
{
}
}
-GLenum get_gl_blend_factor(BlendFactor factor)
+unsigned get_gl_blend_factor(BlendFactor factor)
{
switch(factor)
{
#include <msp/datafile/objectloader.h>
#include <msp/strings/lexicalcast.h>
#include "color.h"
-#include "gl.h"
namespace Msp {
namespace GL {
Blend(BlendEquation, BlendFactor, BlendFactor);
};
-GLenum get_gl_blend_equation(BlendEquation);
-GLenum get_gl_blend_factor(BlendFactor);
+unsigned get_gl_blend_equation(BlendEquation);
+unsigned get_gl_blend_factor(BlendFactor);
void operator>>(const LexicalConverter &, BlendEquation &);
void operator<<(LexicalConverter &, BlendEquation);
#include <stdexcept>
#include <string>
#include <vector>
-#include "gl.h"
namespace Msp {
namespace GL {
#include <msp/linal/matrix.h>
#include <msp/linal/vector.h>
-#include "gl.h"
namespace Msp {
namespace GL {
static const DataType type = static_cast<DataType>((TypeTraits<T>::type&0xF00) | ((TypeTraits<T>::type&0xFF)*N*M) | ((N-1)<<12) | ((M-1)<<14));
};
-GLenum get_gl_type(DataType);
-DataType from_gl_type(GLenum);
+unsigned get_gl_type(DataType);
+DataType from_gl_type(unsigned);
void require_type(DataType);
#include <msp/gl/extensions/arb_draw_buffers.h>
#include <msp/gl/extensions/arb_direct_state_access.h>
+#include <msp/gl/extensions/arb_geometry_shader4.h>
#include <msp/gl/extensions/arb_internalformat_query.h>
#include <msp/gl/extensions/arb_internalformat_query2.h>
#include <msp/gl/extensions/ext_framebuffer_object.h>
#include "color.h"
#include "frameformat.h"
#include "texturecube.h"
-#include <msp/gl/extensions/arb_geometry_shader4.h>
-#include <msp/gl/extensions/ext_framebuffer_multisample.h>
-#include <msp/gl/extensions/ext_framebuffer_object.h>
-#include <msp/gl/extensions/nv_fbo_color_attachments.h>
namespace Msp {
namespace GL {
#include "deviceinfo.h"
#include "error.h"
#include "frameformat.h"
+#include "gl.h"
using namespace std;
return make_pixelformat(comp, type);
}
-GLenum get_gl_attachment(FrameAttachment fa)
+unsigned get_gl_attachment(FrameAttachment fa)
{
if(get_attach_point(fa)==get_attach_point(DEPTH_ATTACHMENT))
return GL_DEPTH_ATTACHMENT;
return GL_COLOR_ATTACHMENT0+get_attach_point(fa);
}
-GLenum get_gl_buffer_bits(const FrameFormat &format)
+unsigned get_gl_buffer_bits(const FrameFormat &format)
{
- GLenum bits = 0;
+ unsigned bits = 0;
for(FrameAttachment a: format)
{
if(get_attach_point(a)==get_attach_point(DEPTH_ATTACHMENT))
PixelFormat get_attachment_pixelformat(FrameAttachment);
-GLenum get_gl_attachment(FrameAttachment);
-GLenum get_gl_buffer_bits(const FrameFormat &);
+unsigned get_gl_attachment(FrameAttachment);
+unsigned get_gl_buffer_bits(const FrameFormat &);
} // namespace GL
} // namespace Msp
#include <vector>
#include <msp/geometry/angle.h>
#include <msp/linal/squarematrix.h>
-#include "gl.h"
#include "vector.h"
namespace Msp {
#include <string>
#include <msp/io/base.h>
#include "datatype.h"
-#include "gl.h"
#include "glsl/compiler.h"
#include "glsl/sourcemap.h"
#include <msp/gl/extensions/arb_shader_objects.h>
#include <msp/gl/extensions/arb_uniform_buffer_object.h>
#include <msp/gl/extensions/arb_vertex_array_object.h>
+#include <msp/gl/extensions/ext_framebuffer_object.h>
#include <msp/gl/extensions/msp_primitive_restart.h>
#include "blend.h"
#include "buffer.h"
}
}
-GLenum get_gl_components(PixelComponents comp)
+unsigned get_gl_components(PixelComponents comp)
{
switch(comp)
{
}
}
-GLenum get_gl_pixelformat(PixelFormat pf)
+unsigned get_gl_pixelformat(PixelFormat pf)
{
switch(pf)
{
#include <msp/graphics/image.h>
#include <msp/strings/lexicalcast.h>
-#include "gl.h"
#include "datatype.h"
namespace Msp {
void require_pixelformat(PixelFormat);
-GLenum get_gl_components(PixelComponents);
-GLenum get_gl_pixelformat(PixelFormat);
+unsigned get_gl_components(PixelComponents);
+unsigned get_gl_pixelformat(PixelFormat);
} // namespace GL
} // namespace Msp
#include <msp/strings/format.h>
+#include "gl.h"
#include "predicate.h"
using namespace std;
namespace Msp {
namespace GL {
-GLenum get_gl_predicate(Predicate pred)
+unsigned get_gl_predicate(Predicate pred)
{
switch(pred)
{
#define MSP_GL_PREDICATE_H_
#include <msp/strings/lexicalcast.h>
-#include "gl.h"
namespace Msp {
namespace GL {
NOTEQUAL
};
-GLenum get_gl_predicate(Predicate);
+unsigned get_gl_predicate(Predicate);
void operator>>(const LexicalConverter &, Predicate &);
void operator<<(LexicalConverter &, Predicate);
#include <msp/strings/format.h>
+#include "gl.h"
#include "primitivetype.h"
using namespace std;
namespace Msp {
namespace GL {
-GLenum get_gl_primitive_type(PrimitiveType pt)
+unsigned get_gl_primitive_type(PrimitiveType pt)
{
switch(pt)
{
#define MSP_GL_PRIMITIVETYPE_H_
#include <msp/strings/lexicalcast.h>
-#include "gl.h"
namespace Msp {
namespace GL {
TRIANGLE_FAN
};
-GLenum get_gl_primitive_type(PrimitiveType);
+unsigned get_gl_primitive_type(PrimitiveType);
void operator>>(const LexicalConverter &, PrimitiveType &);
#include <string>
#include <vector>
#include <msp/datafile/objectloader.h>
-#include "gl.h"
#include "module.h"
#include "reflectdata.h"
#include "vertexformat.h"
filter==LINEAR_MIPMAP_NEAREST || filter==LINEAR_MIPMAP_LINEAR);
}
-GLenum get_gl_filter(TextureFilter filter)
+unsigned get_gl_filter(TextureFilter filter)
{
switch(filter)
{
}
}
-GLenum get_gl_wrap(TextureWrap wrap)
+unsigned get_gl_wrap(TextureWrap wrap)
{
switch(wrap)
{
#include <msp/datafile/objectloader.h>
#include "color.h"
-#include "gl.h"
#include "predicate.h"
namespace Msp {
bool is_mipmapped(TextureFilter);
-GLenum get_gl_filter(TextureFilter);
-GLenum get_gl_wrap(TextureWrap);
+unsigned get_gl_filter(TextureFilter);
+unsigned get_gl_wrap(TextureWrap);
void operator>>(const LexicalConverter &, TextureFilter &);
void operator>>(const LexicalConverter &, TextureWrap &);
#include <stdexcept>
#include <msp/strings/format.h>
+#include "gl.h"
#include "stenciltest.h"
using namespace std;
}
-GLenum get_gl_stencil_op(StencilOp op)
+unsigned get_gl_stencil_op(StencilOp op)
{
switch(op)
{
StencilTest();
};
-GLenum get_gl_stencil_op(StencilOp);
+unsigned get_gl_stencil_op(StencilOp);
void operator>>(const LexicalConverter &, StencilOp &);
void operator<<(LexicalConverter &, StencilOp);
}
}
-void Texture::set_parameter_i(GLenum param, int value) const
+void Texture::set_parameter_i(unsigned param, int value) const
{
if(ARB_direct_state_access)
glTextureParameteri(id, param, value);
#include <msp/datafile/objectloader.h>
#include <msp/graphics/image.h>
-#include "gl.h"
#include "pixelformat.h"
#include "resource.h"
};
unsigned id;
- GLenum target;
+ unsigned target;
PixelFormat format;
PixelFormat storage_fmt;
FormatSwizzle swizzle;
static const int swizzle_orders[];
static Texture *scratch_binding;
- Texture(GLenum, ResourceManager * = 0);
+ Texture(unsigned, ResourceManager * = 0);
Texture(const Texture &);
Texture &operator=(const Texture &);
public:
void generate_id();
void set_format(PixelFormat);
void apply_swizzle();
- void set_parameter_i(GLenum, int) const;
+ void set_parameter_i(unsigned, int) const;
public:
PixelFormat get_format() const { return format; }
}
-GLenum get_gl_cube_face(TextureCubeFace face)
+unsigned get_gl_cube_face(TextureCubeFace face)
{
switch(face)
{
#ifndef MSP_GL_TEXTURECUBE_H_
#define MSP_GL_TEXTURECUBE_H_
-#include <msp/gl/extensions/arb_texture_cube_map.h>
#include <msp/graphics/image.h>
#include "texture.h"
#include "vector.h"
virtual void unload() { }
};
-GLenum get_gl_cube_face(TextureCubeFace);
+unsigned get_gl_cube_face(TextureCubeFace);
void operator>>(const LexicalConverter &, TextureCubeFace &);