1
0
Fork 0

Move OpenGL headers from API to implementation.

We don't want to expose any OpenGL functions to client code. Because if we do, there is a chance we break client code if we switch implementation (Direct3D).
This commit is contained in:
Henrik Hautakoski 2020-01-03 20:30:08 +01:00
parent 1dc0ecf563
commit 2a111a237d
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
13 changed files with 16 additions and 16 deletions

View file

@ -1,7 +0,0 @@
#ifndef SPECTRE_OPENGL_H
#define SPECTRE_OPENGL_H
#include <Spectre/Graphics/GL/glad.h>
#endif /* SPECTRE_OPENGL_H */

View file

@ -1,12 +1,12 @@
#include <Spectre/System/Log.h>
#include <Spectre/Graphics/OpenGL.h>
#include <Spectre/Graphics/Renderable.h>
#include <Spectre/Graphics/RenderState.h>
#include <Spectre/Graphics/ShaderProgram.h>
#include <Spectre/Graphics/Texture.h>
#include <Spectre/Graphics/BatchRenderer2D.h>
#include <Spectre/Math/Math.h>
#include <Graphics/GL/gl.h>
#include <algorithm>

View file

@ -1,8 +1,8 @@
#include <Spectre/Graphics/Texture.h>
#include <Spectre/Graphics/OpenGL.h>
#include <Spectre/Graphics/Renderable.h>
#include <Spectre/Graphics/DefaultRenderer2D.h>
#include <Graphics/GL/gl.h>
namespace sp {

View file

@ -2,7 +2,7 @@
#ifndef SPECTRE_GRAPHICS_GL_CHECKERROR_H
#define SPECTRE_GRAPHICS_GL_CHECKERROR_H
#include <Spectre/Graphics/OpenGL.h>
#include "gl.h"
#define checkGLError(expr) do { expr; glCheckError(__FILE__, __LINE__, #expr); } while(false)

7
source/Graphics/GL/gl.h Normal file
View file

@ -0,0 +1,7 @@
#ifndef SPECTRE_GRAPHICS_GL_GL_H
#define SPECTRE_GRAPHICS_GL_GL_H
#include "glad.h"
#endif /* SPECTRE_GRAPHICS_GL_GL_H */

View file

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Spectre/Graphics/GL/glad.h>
#include "glad.h"
#ifndef GLAD_IMPL_UTIL_C_
#define GLAD_IMPL_UTIL_C_

View file

@ -1,6 +1,6 @@
#include <Spectre/Graphics.h>
#include <Spectre/Graphics/OpenGL.h>
#include <Graphics/GL/gl.h>
#include <string>
namespace sp {

View file

@ -1,8 +1,8 @@
#include <fstream>
#include <Spectre/System/File.h>
#include <Spectre/Graphics/OpenGL.h>
#include <Spectre/Graphics/Shader.h>
#include <Graphics/GL/gl.h>
namespace sp {

View file

@ -1,8 +1,8 @@
#include <Spectre/Math/Color.h>
#include <Spectre/Graphics/OpenGL.h>
#include <Spectre/Graphics/ShaderProgram.h>
#include <Spectre/System/File.h>
#include <Graphics/GL/gl.h>
namespace sp {

View file

@ -1,7 +1,7 @@
#include <Spectre/Graphics/Image.h>
#include <Spectre/Graphics/OpenGL.h>
#include <Spectre/Graphics/Texture.h>
#include <Graphics/GL/gl.h>
namespace sp {

View file

@ -29,7 +29,7 @@
#define GLAD_WGL_H_
#include <windows.h>
#include <Spectre/Graphics/GL/glad.h>
#include <Graphics/GL/glad.h>
#define GLAD_WGL
#define GLAD_OPTION_WGL_LOADER