Implement OpenGL from window-starter
The bulk of the work to create an OpenGL context on windows and load the some of the functions required to get a triangle rendering using modern OpenGL
This commit is contained in:
28
src/opengl.h
Normal file
28
src/opengl.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ogl_starter
|
||||
{
|
||||
class Window;
|
||||
|
||||
struct OpenGLCreateParams
|
||||
{
|
||||
void* nativeWindowHandle;
|
||||
int versionMajor;
|
||||
int versionMinor;
|
||||
};
|
||||
|
||||
class OpenGL
|
||||
{
|
||||
public:
|
||||
virtual ~OpenGL() = default;
|
||||
virtual void ClearBuffers() = 0;
|
||||
virtual void SwapBuffers() = 0;
|
||||
|
||||
virtual void DrawScene() = 0;
|
||||
};
|
||||
|
||||
} // namespace ogl_starter
|
||||
|
||||
std::unique_ptr<ogl_starter::OpenGL> oglsCreateOpenGL(ogl_starter::OpenGLCreateParams params);
|
||||
Reference in New Issue
Block a user