OpenGL: Random stuff I forgot
This commit is contained in:
@@ -23,6 +23,7 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
||||
cb(glBeginQuery, PFNGLBEGINQUERYPROC) \
|
||||
cb(glBindAttribLocation, PFNGLBINDATTRIBLOCATIONPROC) \
|
||||
cb(glBindBuffer, PFNGLBINDBUFFERPROC) \
|
||||
cb(glBindBufferRange, PFNGLBINDBUFFERRANGEPROC) \
|
||||
cb(glBindFramebuffer, PFNGLBINDFRAMEBUFFERPROC) \
|
||||
cb(glBindRenderbuffer, PFNGLBINDRENDERBUFFERPROC) \
|
||||
cb(glBindSampler, PFNGLBINDSAMPLERPROC) \
|
||||
@@ -43,9 +44,10 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
||||
cb(glColorMask, PFNGLCOLORMASKPROC) \
|
||||
cb(glCompressedTexSubImage2D, PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) \
|
||||
cb(glCompressedTexSubImage3D, PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) \
|
||||
cb(glCullFace, PFNGLCULLFACEPROC) \
|
||||
cb(glCompileShader, PFNGLCOMPILESHADERPROC) \
|
||||
cb(glCopyBufferSubData, PFNGLCOPYBUFFERSUBDATAPROC) \
|
||||
cb(glCopyTexSubImage2D, PFNGLCOPYTEXSUBIMAGE2DPROC) \
|
||||
cb(glCullFace, PFNGLCULLFACEPROC) \
|
||||
cb(glDeleteBuffers, PFNGLDELETEBUFFERSPROC) \
|
||||
cb(glDeleteFramebuffers, PFNGLDELETEFRAMEBUFFERSPROC) \
|
||||
cb(glDeleteProgram, PFNGLDELETEPROGRAMPROC) \
|
||||
@@ -123,7 +125,9 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
||||
cb(glTexImage2D, PFNGLTEXIMAGE2DPROC) \
|
||||
cb(glTexImage3D, PFNGLTEXIMAGE3DPROC) \
|
||||
cb(glTexParameterf, PFNGLTEXPARAMETERFPROC) \
|
||||
cb(glTexParameterfv, PFNGLTEXPARAMETERFVPROC) \
|
||||
cb(glTexParameteri, PFNGLTEXPARAMETERIPROC) \
|
||||
cb(glTexParameteriv, PFNGLTEXPARAMETERIVPROC) \
|
||||
cb(glTexStorage2D, PFNGLTEXSTORAGE2DPROC) \
|
||||
cb(glTexStorage3D, PFNGLTEXSTORAGE3DPROC) \
|
||||
cb(glTexSubImage2D, PFNGLTEXSUBIMAGE2DPROC) \
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_OPENGLRENDERER_GLSHADER_HPP
|
||||
#define NAZARA_OPENGLRENDERER_GLSHADER_HPP
|
||||
#ifndef NAZARA_OPENGLRENDERER_GLPROGRAM_HPP
|
||||
#define NAZARA_OPENGLRENDERER_GLPROGRAM_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Core/MovableValue.hpp>
|
||||
|
||||
@@ -24,6 +24,11 @@ namespace Nz::GL
|
||||
Texture(Texture&&) noexcept = default;
|
||||
~Texture() = default;
|
||||
|
||||
inline void SetParameterf(GLenum pname, GLfloat param);
|
||||
inline void SetParameteri(GLenum pname, GLint param);
|
||||
inline void SetParameterfv(GLenum pname, const GLfloat* param);
|
||||
inline void SetParameteriv(GLenum pname, const GLint* param);
|
||||
|
||||
inline void TexImage2D(GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border);
|
||||
inline void TexImage2D(GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* data);
|
||||
inline void TexSubImage2D(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data);
|
||||
|
||||
@@ -8,6 +8,38 @@
|
||||
|
||||
namespace Nz::GL
|
||||
{
|
||||
inline void Texture::SetParameterf(GLenum pname, GLfloat param)
|
||||
{
|
||||
assert(m_objectId);
|
||||
|
||||
const Context& context = EnsureDeviceContext();
|
||||
context.glTexParameterf(m_objectId, pname, param);
|
||||
}
|
||||
|
||||
inline void Texture::SetParameteri(GLenum pname, GLint param)
|
||||
{
|
||||
assert(m_objectId);
|
||||
|
||||
const Context& context = EnsureDeviceContext();
|
||||
context.glTexParameteri(m_objectId, pname, param);
|
||||
}
|
||||
|
||||
inline void Texture::SetParameterfv(GLenum pname, const GLfloat* param)
|
||||
{
|
||||
assert(m_objectId);
|
||||
|
||||
const Context& context = EnsureDeviceContext();
|
||||
context.glTexParameterfv(m_objectId, pname, param);
|
||||
}
|
||||
|
||||
inline void Texture::SetParameteriv(GLenum pname, const GLint* param)
|
||||
{
|
||||
assert(m_objectId);
|
||||
|
||||
const Context& context = EnsureDeviceContext();
|
||||
context.glTexParameteriv(m_objectId, pname, param);
|
||||
}
|
||||
|
||||
inline void Texture::TexImage2D(GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border)
|
||||
{
|
||||
return TexImage2D(level, internalFormat, width, height, border, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
|
||||
|
||||
Reference in New Issue
Block a user