wx_BGI_Graphics
Classic BGI-compatible graphics API with modern OpenGL extension API
Loading...
Searching...
No Matches
bgi_gl.h
Go to the documentation of this file.
1#pragma once
26#include <GL/glew.h>
27#include <glm/glm.hpp>
28
29#include "bgi_types.h" // bgi::LightState, bgi::PendingGlRender, bgi::GlVertex, bgi::GlLineVertex
30
31namespace bgi
32{
33
34// ---------------------------------------------------------------------------
35// Lifecycle
36// ---------------------------------------------------------------------------
37
41void glPassInit(int w, int h);
42
44void glPassResize(int w, int h);
45
48
54
55// ---------------------------------------------------------------------------
56// Rendering passes (call in order for correct compositing)
57// ---------------------------------------------------------------------------
58
66void renderPageAsTexture(int w, int h, int vpW = -1, int vpH = -1);
67
79void renderPageAsTextureAlpha(int w, int h, int vpW = -1, int vpH = -1);
80
84void renderSolidsGLPass(const PendingGlRender &pending, int w, int h,
85 const LightState &light, const glm::mat4 &vp,
86 const glm::vec3 &camPos, int vpX = 0, int vpY = 0);
87
92void renderWireframeGLPass(const PendingGlRender &pending, int w, int h,
93 const glm::mat4 &vp, const glm::vec3 &camPos,
94 int vpX = 0, int vpY = 0);
95
98void renderWorldLinesGLPass(const PendingGlRender &pending, int w, int h,
99 const glm::mat4 &vp, int vpX = 0, int vpY = 0);
100
102void renderPageLegacyPoints(int w, int h, int vpW = -1, int vpH = -1);
103
104} // namespace bgi
105
Definition bgi_camera.h:28
void glPassInit(int w, int h)
Initialise GL objects (shaders, VAO/VBO, page texture).
void glPassResize(int w, int h)
Resize the page texture to match a new canvas size.
void renderWorldLinesGLPass(const PendingGlRender &pending, int w, int h, const glm::mat4 &vp, int vpX=0, int vpY=0)
Pass 3 — Draw world-space line segments with depth test (hidden behind solids).
void glPassDestroy()
Release all GL objects (call before context is destroyed).
void renderPageLegacyPoints(int w, int h, int vpW=-1, int vpH=-1)
Legacy per-pixel GL_POINTS path (kept for backward compat / diagnostics).
void renderPageAsTextureAlpha(int w, int h, int vpW=-1, int vpH=-1)
Overlay pass — Upload the visual page buffer as an RGBA texture and composite it ON TOP of the curren...
void renderWireframeGLPass(const PendingGlRender &pending, int w, int h, const glm::mat4 &vp, const glm::vec3 &camPos, int vpX=0, int vpY=0)
Pass 2b — Two-pass hidden-line wireframe with proper depth-buffer HSR.
void glPassResetState()
Reset GL object handles to zero WITHOUT calling GL delete functions.
void renderSolidsGLPass(const PendingGlRender &pending, int w, int h, const LightState &light, const glm::mat4 &vp, const glm::vec3 &camPos, int vpX=0, int vpY=0)
Pass 2a — Draw Phong-lit solid triangles (flat and/or smooth shading) with depth test.
void renderPageAsTexture(int w, int h, int vpW=-1, int vpH=-1)
Pass 1 — Upload the visual page buffer as an RGBA texture and draw a fullscreen quad.
Lighting parameters used by the GL Phong shading passes.
Definition bgi_types.h:488
Geometry accumulated for a single wxbgi_render_dds() call.
Definition bgi_types.h:526