]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/OpenGL/ExtensionHandler.h
Fix line endings in the new driver
[irrlicht.git] / source / Irrlicht / OpenGL / ExtensionHandler.h
index 1e6bd7f054732dee09f1f4e7c28b2f728b8a0b03..6fb47b8bdf702623f62d96ea91e53d7740e17a4f 100644 (file)
-// Copyright (C) 2023 Vitaliy Lobachevskiy\r
-// Copyright (C) 2015 Patryk Nadrowski\r
-// Copyright (C) 2009-2010 Amundis\r
-// This file is part of the "Irrlicht Engine".\r
-// For conditions of distribution and use, see copyright notice in Irrlicht.h\r
-\r
-#pragma once\r
-\r
-#include "EDriverFeatures.h"\r
-#include "irrTypes.h"\r
-#include "os.h"\r
-\r
-#include "Common.h"\r
-\r
-#include "COGLESCoreExtensionHandler.h"\r
-\r
-namespace irr\r
-{\r
-namespace video\r
-{\r
-\r
-       class COpenGL3ExtensionHandler : public COGLESCoreExtensionHandler\r
-       {\r
-       public:\r
-               COpenGL3ExtensionHandler() : COGLESCoreExtensionHandler() {}\r
-\r
-               void initExtensions();\r
-\r
-               bool queryFeature(video::E_VIDEO_DRIVER_FEATURE feature) const\r
-               {\r
-                       switch (feature)\r
-                       {\r
-                       case EVDF_RENDER_TO_TARGET:\r
-                       case EVDF_HARDWARE_TL:\r
-                       case EVDF_MULTITEXTURE:\r
-                       case EVDF_BILINEAR_FILTER:\r
-                       case EVDF_MIP_MAP:\r
-                       case EVDF_MIP_MAP_AUTO_UPDATE:\r
-                       case EVDF_VERTEX_SHADER_1_1:\r
-                       case EVDF_PIXEL_SHADER_1_1:\r
-                       case EVDF_PIXEL_SHADER_1_2:\r
-                       case EVDF_PIXEL_SHADER_2_0:\r
-                       case EVDF_VERTEX_SHADER_2_0:\r
-                       case EVDF_ARB_GLSL:\r
-                       case EVDF_TEXTURE_NSQUARE:\r
-                       case EVDF_TEXTURE_NPOT:\r
-                       case EVDF_FRAMEBUFFER_OBJECT:\r
-                       case EVDF_VERTEX_BUFFER_OBJECT:\r
-                       case EVDF_COLOR_MASK:\r
-                       case EVDF_ALPHA_TO_COVERAGE:\r
-                       case EVDF_POLYGON_OFFSET:\r
-                       case EVDF_BLEND_OPERATIONS:\r
-                       case EVDF_BLEND_SEPARATE:\r
-                       case EVDF_TEXTURE_MATRIX:\r
-                       case EVDF_TEXTURE_CUBEMAP:\r
-                               return true;\r
-                       case EVDF_ARB_VERTEX_PROGRAM_1:\r
-                       case EVDF_ARB_FRAGMENT_PROGRAM_1:\r
-                       case EVDF_GEOMETRY_SHADER:\r
-                       case EVDF_MULTIPLE_RENDER_TARGETS:\r
-                       case EVDF_MRT_BLEND:\r
-                       case EVDF_MRT_COLOR_MASK:\r
-                       case EVDF_MRT_BLEND_FUNC:\r
-                       case EVDF_OCCLUSION_QUERY:\r
-                               return false;\r
-                       case EVDF_TEXTURE_COMPRESSED_DXT:\r
-                               return false; // NV Tegra need improvements here\r
-                       case EVDF_TEXTURE_COMPRESSED_PVRTC:\r
-                               return FeatureAvailable[IRR_GL_IMG_texture_compression_pvrtc];\r
-                       case EVDF_TEXTURE_COMPRESSED_PVRTC2:\r
-                               return FeatureAvailable[IRR_GL_IMG_texture_compression_pvrtc2];\r
-                       case EVDF_TEXTURE_COMPRESSED_ETC1:\r
-                               return FeatureAvailable[IRR_GL_OES_compressed_ETC1_RGB8_texture];\r
-                       case EVDF_TEXTURE_COMPRESSED_ETC2:\r
-                               return false;\r
-                       case EVDF_STENCIL_BUFFER:\r
-                               return StencilBuffer;\r
-                       default:\r
-                               return false;\r
-                       };\r
-               }\r
-\r
-               inline void irrGlActiveTexture(GLenum texture)\r
-               {\r
-                       glActiveTexture(texture);\r
-               }\r
-\r
-               inline void irrGlCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,\r
-                       GLsizei imageSize, const void* data)\r
-               {\r
-                       glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);\r
-               }\r
-\r
-               inline void irrGlCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,\r
-                       GLenum format, GLsizei imageSize, const void* data)\r
-               {\r
-                       glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);\r
-               }\r
-\r
-               inline void irrGlUseProgram(GLuint prog)\r
-               {\r
-                       glUseProgram(prog);\r
-               }\r
-\r
-               inline void irrGlBindFramebuffer(GLenum target, GLuint framebuffer)\r
-               {\r
-                       glBindFramebuffer(target, framebuffer);\r
-               }\r
-\r
-               inline void irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)\r
-               {\r
-                       glDeleteFramebuffers(n, framebuffers);\r
-               }\r
-\r
-               inline void irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers)\r
-               {\r
-                       glGenFramebuffers(n, framebuffers);\r
-               }\r
-\r
-               inline GLenum irrGlCheckFramebufferStatus(GLenum target)\r
-               {\r
-                       return glCheckFramebufferStatus(target);\r
-               }\r
-\r
-               inline void irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)\r
-               {\r
-                       glFramebufferTexture2D(target, attachment, textarget, texture, level);\r
-               }\r
-\r
-               inline void irrGlGenerateMipmap(GLenum target)\r
-               {\r
-                       glGenerateMipmap(target);\r
-               }\r
-\r
-               inline void irrGlActiveStencilFace(GLenum face)\r
-               {\r
-               }\r
-\r
-               inline void irrGlDrawBuffer(GLenum mode)\r
-               {\r
-               }\r
-\r
-               inline void irrGlDrawBuffers(GLsizei n, const GLenum *bufs)\r
-               {\r
-               }\r
-\r
-               inline void irrGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)\r
-               {\r
-                       glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);\r
-               }\r
-\r
-               inline void irrGlBlendEquation(GLenum mode)\r
-               {\r
-                       glBlendEquation(mode);\r
-               }\r
-\r
-               inline void irrGlEnableIndexed(GLenum target, GLuint index)\r
-               {\r
-               }\r
-\r
-               inline void irrGlDisableIndexed(GLenum target, GLuint index)\r
-               {\r
-               }\r
-\r
-               inline void irrGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)\r
-               {\r
-               }\r
-\r
-               inline void irrGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst)\r
-               {\r
-               }\r
-\r
-               inline void irrGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)\r
-               {\r
-               }\r
-\r
-               inline void irrGlBlendEquationIndexed(GLuint buf, GLenum mode)\r
-               {\r
-               }\r
-\r
-               inline void irrGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha)\r
-               {\r
-               }\r
-       };\r
-\r
-}\r
-}\r
+// Copyright (C) 2023 Vitaliy Lobachevskiy
+// Copyright (C) 2015 Patryk Nadrowski
+// Copyright (C) 2009-2010 Amundis
+// This file is part of the "Irrlicht Engine".
+// For conditions of distribution and use, see copyright notice in Irrlicht.h
+
+#pragma once
+
+#include "EDriverFeatures.h"
+#include "irrTypes.h"
+#include "os.h"
+
+#include "Common.h"
+
+#include "COGLESCoreExtensionHandler.h"
+
+namespace irr
+{
+namespace video
+{
+
+       class COpenGL3ExtensionHandler : public COGLESCoreExtensionHandler
+       {
+       public:
+               COpenGL3ExtensionHandler() : COGLESCoreExtensionHandler() {}
+
+               void initExtensions();
+
+               bool queryFeature(video::E_VIDEO_DRIVER_FEATURE feature) const
+               {
+                       switch (feature)
+                       {
+                       case EVDF_RENDER_TO_TARGET:
+                       case EVDF_HARDWARE_TL:
+                       case EVDF_MULTITEXTURE:
+                       case EVDF_BILINEAR_FILTER:
+                       case EVDF_MIP_MAP:
+                       case EVDF_MIP_MAP_AUTO_UPDATE:
+                       case EVDF_VERTEX_SHADER_1_1:
+                       case EVDF_PIXEL_SHADER_1_1:
+                       case EVDF_PIXEL_SHADER_1_2:
+                       case EVDF_PIXEL_SHADER_2_0:
+                       case EVDF_VERTEX_SHADER_2_0:
+                       case EVDF_ARB_GLSL:
+                       case EVDF_TEXTURE_NSQUARE:
+                       case EVDF_TEXTURE_NPOT:
+                       case EVDF_FRAMEBUFFER_OBJECT:
+                       case EVDF_VERTEX_BUFFER_OBJECT:
+                       case EVDF_COLOR_MASK:
+                       case EVDF_ALPHA_TO_COVERAGE:
+                       case EVDF_POLYGON_OFFSET:
+                       case EVDF_BLEND_OPERATIONS:
+                       case EVDF_BLEND_SEPARATE:
+                       case EVDF_TEXTURE_MATRIX:
+                       case EVDF_TEXTURE_CUBEMAP:
+                               return true;
+                       case EVDF_ARB_VERTEX_PROGRAM_1:
+                       case EVDF_ARB_FRAGMENT_PROGRAM_1:
+                       case EVDF_GEOMETRY_SHADER:
+                       case EVDF_MULTIPLE_RENDER_TARGETS:
+                       case EVDF_MRT_BLEND:
+                       case EVDF_MRT_COLOR_MASK:
+                       case EVDF_MRT_BLEND_FUNC:
+                       case EVDF_OCCLUSION_QUERY:
+                               return false;
+                       case EVDF_TEXTURE_COMPRESSED_DXT:
+                               return false; // NV Tegra need improvements here
+                       case EVDF_TEXTURE_COMPRESSED_PVRTC:
+                               return FeatureAvailable[IRR_GL_IMG_texture_compression_pvrtc];
+                       case EVDF_TEXTURE_COMPRESSED_PVRTC2:
+                               return FeatureAvailable[IRR_GL_IMG_texture_compression_pvrtc2];
+                       case EVDF_TEXTURE_COMPRESSED_ETC1:
+                               return FeatureAvailable[IRR_GL_OES_compressed_ETC1_RGB8_texture];
+                       case EVDF_TEXTURE_COMPRESSED_ETC2:
+                               return false;
+                       case EVDF_STENCIL_BUFFER:
+                               return StencilBuffer;
+                       default:
+                               return false;
+                       };
+               }
+
+               inline void irrGlActiveTexture(GLenum texture)
+               {
+                       glActiveTexture(texture);
+               }
+
+               inline void irrGlCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,
+                       GLsizei imageSize, const void* data)
+               {
+                       glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+               }
+
+               inline void irrGlCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+                       GLenum format, GLsizei imageSize, const void* data)
+               {
+                       glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+               }
+
+               inline void irrGlUseProgram(GLuint prog)
+               {
+                       glUseProgram(prog);
+               }
+
+               inline void irrGlBindFramebuffer(GLenum target, GLuint framebuffer)
+               {
+                       glBindFramebuffer(target, framebuffer);
+               }
+
+               inline void irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
+               {
+                       glDeleteFramebuffers(n, framebuffers);
+               }
+
+               inline void irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers)
+               {
+                       glGenFramebuffers(n, framebuffers);
+               }
+
+               inline GLenum irrGlCheckFramebufferStatus(GLenum target)
+               {
+                       return glCheckFramebufferStatus(target);
+               }
+
+               inline void irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+               {
+                       glFramebufferTexture2D(target, attachment, textarget, texture, level);
+               }
+
+               inline void irrGlGenerateMipmap(GLenum target)
+               {
+                       glGenerateMipmap(target);
+               }
+
+               inline void irrGlActiveStencilFace(GLenum face)
+               {
+               }
+
+               inline void irrGlDrawBuffer(GLenum mode)
+               {
+               }
+
+               inline void irrGlDrawBuffers(GLsizei n, const GLenum *bufs)
+               {
+               }
+
+               inline void irrGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+               {
+                       glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
+               }
+
+               inline void irrGlBlendEquation(GLenum mode)
+               {
+                       glBlendEquation(mode);
+               }
+
+               inline void irrGlEnableIndexed(GLenum target, GLuint index)
+               {
+               }
+
+               inline void irrGlDisableIndexed(GLenum target, GLuint index)
+               {
+               }
+
+               inline void irrGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+               {
+               }
+
+               inline void irrGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst)
+               {
+               }
+
+               inline void irrGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+               {
+               }
+
+               inline void irrGlBlendEquationIndexed(GLuint buf, GLenum mode)
+               {
+               }
+
+               inline void irrGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
+               {
+               }
+       };
+
+}
+}