mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00

This currently (obviously) doesn't support any actual 3D hardware, hence all calls are done via software rendering. Note that any modern constructs such as shaders are unsupported, as this driver only implements Fixed Function Pipeline functionality. The library is split into a base GLContext interface and a software based renderer implementation of said interface. The global glXXX functions serve as an OpenGL compatible c-style interface to the currently bound context instance. Co-authored-by: Stephan Unverwerth <s.unverwerth@gmx.de>
36 lines
674 B
C++
36 lines
674 B
C++
/*
|
|
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
|
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@gmx.de>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "GL/gl.h"
|
|
#include "GLContext.h"
|
|
|
|
extern GL::GLContext* g_gl_context;
|
|
|
|
void glBegin(GLenum mode)
|
|
{
|
|
g_gl_context->gl_begin(mode);
|
|
}
|
|
|
|
void glEnd()
|
|
{
|
|
g_gl_context->gl_end();
|
|
}
|
|
|
|
void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
|
|
{
|
|
g_gl_context->gl_vertex(x, y, z, 1.0);
|
|
}
|
|
|
|
void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
|
|
{
|
|
g_gl_context->gl_rotate(angle, x, y, z);
|
|
}
|
|
|
|
void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
|
|
{
|
|
g_gl_context->gl_translate(x, y, z);
|
|
}
|