mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 01:42:44 +00:00 
			
		
		
		
	 a8fc4be47a
			
		
	
	
		a8fc4be47a
		
	
	
	
	
		
			
			This adds glClearDepth() and new caps for enabling and disabling the depth buffer with glEnable() and glDisable()
		
			
				
	
	
		
			121 lines
		
	
	
	
		
			3.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			121 lines
		
	
	
	
		
			3.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| extern "C" {
 | |
| #endif
 | |
| 
 | |
| #ifndef GLAPI
 | |
| #    define GLAPI extern
 | |
| #endif
 | |
| 
 | |
| // OpenGL related `defines`
 | |
| #define GL_TRUE 1
 | |
| #define GL_FALSE 0
 | |
| 
 | |
| // Matrix Modes
 | |
| #define GL_MODELVIEW 0x0050
 | |
| #define GL_PROJECTION 0x0051
 | |
| 
 | |
| // glBegin/glEnd primitive types
 | |
| #define GL_TRIANGLES 0x0100
 | |
| #define GL_QUADS 0x0101
 | |
| #define GL_TRIANGLE_FAN 0x0102
 | |
| #define GL_TRIANGLE_STRIP 0x0103
 | |
| #define GL_POLYGON 0x0104
 | |
| 
 | |
| // Buffer bits
 | |
| #define GL_COLOR_BUFFER_BIT 0x0200
 | |
| #define GL_DEPTH_BUFFER_BIT 0x0400
 | |
| 
 | |
| // Enable capabilities
 | |
| #define GL_CULL_FACE 0x0B44
 | |
| #define GL_DEPTH_TEST 0x0B71
 | |
| 
 | |
| // Utility
 | |
| #define GL_VENDOR 0x1F00
 | |
| #define GL_RENDERER 0x1F01
 | |
| #define GL_VERSION 0x1F02
 | |
| 
 | |
| // Culled face side
 | |
| #define GL_FRONT 0x0404
 | |
| #define GL_BACK 0x0405
 | |
| #define GL_FRONT_AND_BACK 0x0408
 | |
| 
 | |
| // Error codes
 | |
| #define GL_NO_ERROR 0
 | |
| #define GL_INVALID_ENUM 0x500
 | |
| #define GL_INVALID_VALUE 0x501
 | |
| #define GL_INVALID_OPERATION 0x502
 | |
| #define GL_STACK_OVERFLOW 0x0503
 | |
| #define GL_STACK_UNDERFLOW 0x0504
 | |
| #define GL_OUT_OF_MEMORY 0x505
 | |
| #define GL_INVALID_FRAMEBUFFER_OPERATION 0x506
 | |
| 
 | |
| // Triangle winding order
 | |
| #define GL_CW 0x0900
 | |
| #define GL_CCW 0x0901
 | |
| 
 | |
| //
 | |
| // OpenGL typedefs
 | |
| //
 | |
| // Defines types used by all OpenGL applications
 | |
| // https://www.khronos.org/opengl/wiki/OpenGL_Type
 | |
| typedef char GLchar;
 | |
| typedef unsigned char GLuchar;
 | |
| typedef unsigned char GLubyte;
 | |
| typedef short GLshort;
 | |
| typedef unsigned short GLushort;
 | |
| typedef int GLint;
 | |
| typedef unsigned int GLuint;
 | |
| typedef int GLfixed;
 | |
| typedef long long GLint64;
 | |
| typedef unsigned long long GLuint64;
 | |
| typedef unsigned long GLsizei;
 | |
| typedef void GLvoid;
 | |
| typedef float GLfloat;
 | |
| typedef float GLclampf;
 | |
| typedef double GLdouble;
 | |
| typedef unsigned int GLenum;
 | |
| typedef unsigned int GLbitfield;
 | |
| 
 | |
| GLAPI void glBegin(GLenum mode);
 | |
| GLAPI void glClear(GLbitfield mask);
 | |
| GLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
 | |
| GLAPI void glClearDepth(GLdouble depth);
 | |
| GLAPI void glColor3f(GLfloat r, GLfloat g, GLfloat b);
 | |
| GLAPI void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
 | |
| GLAPI void glColor4fv(const GLfloat* v);
 | |
| GLAPI void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
 | |
| GLAPI void glColor4ubv(const GLubyte* v);
 | |
| GLAPI void glEnd();
 | |
| GLAPI void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal);
 | |
| GLAPI GLenum glGetError();
 | |
| GLAPI GLubyte* glGetString(GLenum name);
 | |
| GLAPI void glLoadIdentity();
 | |
| GLAPI void glLoadMatrixf(const GLfloat* matrix);
 | |
| GLAPI void glMatrixMode(GLenum mode);
 | |
| GLAPI void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal);
 | |
| GLAPI void glPushMatrix();
 | |
| GLAPI void glPopMatrix();
 | |
| GLAPI void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
 | |
| GLAPI void glScalef(GLfloat x, GLfloat y, GLfloat z);
 | |
| GLAPI void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
 | |
| GLAPI void glVertex2f(GLfloat x, GLfloat y);
 | |
| GLAPI void glVertex2fv(const GLfloat* v);
 | |
| GLAPI void glVertex3f(GLfloat x, GLfloat y, GLfloat z);
 | |
| GLAPI void glVertex3fv(const GLfloat* v);
 | |
| GLAPI void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
 | |
| GLAPI void glEnable(GLenum cap);
 | |
| GLAPI void glDisable(GLenum cap);
 | |
| GLAPI void glCullFace(GLenum mode);
 | |
| GLAPI void glFrontFace(GLenum mode);
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| }
 | |
| #endif
 |