wx_BGI_Graphics
Classic BGI-compatible graphics API with modern OpenGL extension API
Loading...
Searching...
No Matches
Data Structures | Namespaces | Macros | Typedefs | Enumerations | Variables
bgi_types.h File Reference
#include <array>
#include <cstdint>
#include <memory>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for bgi_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bgi::arccoordstype
 
struct  bgi::BgiState
 
struct  bgi::Camera3D
 3-D camera definition (Z-up, right-handed world coordinate system). More...
 
struct  bgi::ColorRGB
 
struct  bgi::CoordSystem
 A named user coordinate system (UCS). More...
 
struct  bgi::fillsettingstype
 
struct  bgi::GlLineVertex
 One vertex in a GL depth-tested line batch (world-space, 6 floats). More...
 
struct  bgi::GlVertex
 One vertex in a GL solid triangle batch (world-space, 9 floats). More...
 
struct  bgi::ImageHeader
 
struct  bgi::LightState
 Lighting parameters used by the GL Phong shading passes. More...
 
struct  bgi::linesettingstype
 
struct  bgi::MouseClickEvent
 
struct  bgi::OverlayGridState
 State for the reference grid overlay. More...
 
struct  bgi::OverlayUcsAxesState
 State for the UCS axes overlay. More...
 
struct  bgi::palettetype
 
struct  bgi::PendingGlFrame
 Per-camera GL frame queued by wxbgi_render_dds() in wxEmbedded mode. More...
 
struct  bgi::PendingGlRender
 Geometry accumulated for a single wxbgi_render_dds() call. More...
 
struct  bgi::textsettingstype
 
struct  bgi::viewporttype
 
struct  bgi::WorldExtents
 Axis-aligned bounding box (AABB) representing the programmer's declared drawing extents in world space. More...
 

Namespaces

namespace  bgi
 

Macros

#define BGI_API   extern "C"
 
#define BGI_CALL
 
Input default-behavior flags

Bitmask constants for wxbgi_set_input_defaults().

Combine with bitwise OR; pass WXBGI_DEFAULT_ALL to restore all defaults.

#define WXBGI_DEFAULT_ALL   0x0F
 All default behaviors enabled (initial state after initwindow).
 
#define WXBGI_DEFAULT_CURSOR_TRACK   0x02
 Cursor tracking: cursorPosCallback writes mouseX / mouseY / mouseMoved.
 
#define WXBGI_DEFAULT_KEY_QUEUE   0x01
 Key-code queuing: keyCallback updates keyQueue + charCallback queues chars.
 
#define WXBGI_DEFAULT_MOUSE_PICK   0x04
 Mouse-button picking: mouseButtonCallback calls overlayPerformPick().
 
#define WXBGI_DEFAULT_NONE   0x00
 All default behaviors disabled.
 
#define WXBGI_DEFAULT_SCROLL_ACCUM   0x08
 Scroll accumulation: scrollCallback accumulates scrollDeltaX / scrollDeltaY.
 
Navigation and function key codes

Named constants for keyboard keys, matching GLFW values for hook callback compatibility.

Use with wxbgi_is_key_down() and hook callbacks.

#define WXBGI_KEY_APOSTROPHE   39
 
#define WXBGI_KEY_BACKSPACE   259
 
#define WXBGI_KEY_COMMA   44
 
#define WXBGI_KEY_DELETE   261
 
#define WXBGI_KEY_DOWN   264
 
#define WXBGI_KEY_END   269
 
#define WXBGI_KEY_ENTER   257
 
#define WXBGI_KEY_EQUAL   61
 
#define WXBGI_KEY_ESCAPE   256
 
#define WXBGI_KEY_F1   290
 
#define WXBGI_KEY_F10   299
 
#define WXBGI_KEY_F11   300
 
#define WXBGI_KEY_F12   301
 
#define WXBGI_KEY_F2   291
 
#define WXBGI_KEY_F3   292
 
#define WXBGI_KEY_F4   293
 
#define WXBGI_KEY_F5   294
 
#define WXBGI_KEY_F6   295
 
#define WXBGI_KEY_F7   296
 
#define WXBGI_KEY_F8   297
 
#define WXBGI_KEY_F9   298
 
#define WXBGI_KEY_HOME   268
 
#define WXBGI_KEY_INSERT   260
 
#define WXBGI_KEY_LEFT   263
 
#define WXBGI_KEY_LEFT_BRACKET   91
 
#define WXBGI_KEY_MINUS   45
 
#define WXBGI_KEY_PAGE_DOWN   267
 
#define WXBGI_KEY_PAGE_UP   266
 
#define WXBGI_KEY_PERIOD   46
 
#define WXBGI_KEY_RIGHT   262
 
#define WXBGI_KEY_RIGHT_BRACKET   93
 
#define WXBGI_KEY_SEMICOLON   59
 
#define WXBGI_KEY_SLASH   47
 
#define WXBGI_KEY_SPACE   32
 
#define WXBGI_KEY_TAB   258
 
#define WXBGI_KEY_UP   265
 

Typedefs

using bgi::MouseHandler = void(BGI_CALL *)(int, int)
 
typedef void(BGI_CALLWxbgiCharHook) (unsigned int codepoint)
 User hook fired after each printable Unicode character input event.
 
typedef void(BGI_CALLWxbgiCursorPosHook) (int x, int y)
 User hook fired after every mouse cursor movement.
 
typedef void(BGI_CALLWxbgiKeyHook) (int key, int scancode, int action, int mods)
 User hook fired after each key press, repeat, or release event.
 
typedef void(BGI_CALLWxbgiMouseButtonHook) (int button, int action, int mods)
 User hook fired after each mouse button press or release.
 
typedef void(BGI_CALLWxbgiScrollHook) (double xoffset, double yoffset)
 User hook fired after each mouse scroll (wheel) event.
 

Enumerations

enum class  bgi::CameraProjection { bgi::Orthographic = 0 , bgi::Perspective = 1 }
 Projection mode for a Camera3D. More...
 
enum  bgi::GraphStatus {
  bgi::grOk = 0 , bgi::grNoInitGraph = -1 , bgi::grNotDetected = -2 , bgi::grFileNotFound = -3 ,
  bgi::grInvalidDriver = -4 , bgi::grNoLoadMem = -5 , bgi::grNoScanMem = -6 , bgi::grNoFloodMem = -7 ,
  bgi::grFontNotFound = -8 , bgi::grNoFontMem = -9 , bgi::grInvalidMode = -10 , bgi::grError = -11 ,
  bgi::grIOerror = -12 , bgi::grInvalidFont = -13 , bgi::grInvalidFontNum = -14 , bgi::grInvalidVersion = -18 ,
  bgi::grInitFailed = -19 , bgi::grWindowClosed = -20 , bgi::grInvalidInput = -21 , bgi::grDuplicateName = -22
}
 

Variables

constexpr int bgi::AND_PUT = 3
 
constexpr int bgi::BKSLASH_FILL = 5
 
constexpr int bgi::BLACK = 0
 
constexpr int bgi::BLUE = 1
 
constexpr int bgi::BOTTOM_TEXT = 0
 
constexpr int bgi::BROWN = 6
 
constexpr int bgi::CENTER_LINE = 2
 
constexpr int bgi::CENTER_TEXT = 1
 
constexpr int bgi::CLOSE_DOT_FILL = 11
 
constexpr int bgi::COPY_PUT = 0
 
constexpr int bgi::CYAN = 3
 
constexpr int bgi::DARKGRAY = 8
 
constexpr int bgi::DASHED_LINE = 3
 
constexpr int bgi::DEFAULT_FONT = 0
 
constexpr int bgi::DETECT = 0
 
constexpr int bgi::DOTTED_LINE = 1
 
constexpr int bgi::EMPTY_FILL = 0
 
constexpr int bgi::GOTHIC_FONT = 8
 
constexpr int bgi::GREEN = 2
 
constexpr int bgi::HATCH_FILL = 7
 
constexpr int bgi::HORIZ_DIR = 0
 
constexpr int bgi::INTERLEAVE_FILL = 9
 
const ColorRGB bgi::kBgiPalette [kPaletteSize]
 
constexpr int bgi::kDefaultHeight = 720
 
constexpr int bgi::kDefaultWidth = 960
 
constexpr int bgi::kExtColorBase = 16
 first user-assignable extended colour index
 
constexpr int bgi::kExtPaletteSize = 240
 extended slots 16-255 (fits uint8_t pixel buffer)
 
constexpr int bgi::kPageCount = 2
 
constexpr int bgi::kPaletteSize = 16
 classic BGI palette slots (0-15)
 
constexpr int bgi::kPatternCols = 8
 
constexpr int bgi::kPatternRows = 8
 
constexpr int bgi::kSelectionOrangeColor = 252
 Reserved extended-palette slot — selection flash orange.
 
constexpr int bgi::kSelectionPurpleColor = 253
 Reserved extended-palette slot — selection flash purple.
 
constexpr int bgi::LEFT_TEXT = 0
 
constexpr int bgi::LIGHTBLUE = 9
 
constexpr int bgi::LIGHTCYAN = 11
 
constexpr int bgi::LIGHTGRAY = 7
 
constexpr int bgi::LIGHTGREEN = 10
 
constexpr int bgi::LIGHTMAGENTA = 13
 
constexpr int bgi::LIGHTRED = 12
 
constexpr int bgi::LINE_FILL = 2
 
constexpr int bgi::LTBKSLASH_FILL = 6
 
constexpr int bgi::LTSLASH_FILL = 3
 
constexpr int bgi::MAGENTA = 5
 
constexpr int bgi::NORM_WIDTH = 1
 
constexpr int bgi::NOT_PUT = 4
 
constexpr int bgi::OR_PUT = 2
 
constexpr int bgi::RED = 4
 
constexpr int bgi::RIGHT_TEXT = 2
 
constexpr int bgi::SANS_SERIF_FONT = 4
 
constexpr int bgi::SLASH_FILL = 4
 
constexpr int bgi::SMALL_FONT = 2
 
constexpr int bgi::SOLID_FILL = 1
 
constexpr int bgi::SOLID_LINE = 0
 
constexpr int bgi::THICK_WIDTH = 3
 
constexpr int bgi::TOP_TEXT = 2
 
constexpr int bgi::TRIPLEX_FONT = 1
 
constexpr int bgi::USER_FILL = 12
 
constexpr int bgi::USERBIT_LINE = 4
 
constexpr int bgi::VERT_DIR = 1
 
constexpr int bgi::WHITE = 15
 
constexpr int bgi::WIDE_DOT_FILL = 10
 
constexpr int bgi::XHATCH_FILL = 8
 
constexpr int bgi::XOR_PUT = 1
 
constexpr int bgi::YELLOW = 14
 

Macro Definition Documentation

◆ BGI_API

#define BGI_API   extern "C"

◆ BGI_CALL

#define BGI_CALL

◆ WXBGI_DEFAULT_ALL

#define WXBGI_DEFAULT_ALL   0x0F

All default behaviors enabled (initial state after initwindow).

◆ WXBGI_DEFAULT_CURSOR_TRACK

#define WXBGI_DEFAULT_CURSOR_TRACK   0x02

Cursor tracking: cursorPosCallback writes mouseX / mouseY / mouseMoved.

◆ WXBGI_DEFAULT_KEY_QUEUE

#define WXBGI_DEFAULT_KEY_QUEUE   0x01

Key-code queuing: keyCallback updates keyQueue + charCallback queues chars.

◆ WXBGI_DEFAULT_MOUSE_PICK

#define WXBGI_DEFAULT_MOUSE_PICK   0x04

Mouse-button picking: mouseButtonCallback calls overlayPerformPick().

◆ WXBGI_DEFAULT_NONE

#define WXBGI_DEFAULT_NONE   0x00

All default behaviors disabled.

◆ WXBGI_DEFAULT_SCROLL_ACCUM

#define WXBGI_DEFAULT_SCROLL_ACCUM   0x08

Scroll accumulation: scrollCallback accumulates scrollDeltaX / scrollDeltaY.

◆ WXBGI_KEY_APOSTROPHE

#define WXBGI_KEY_APOSTROPHE   39

◆ WXBGI_KEY_BACKSPACE

#define WXBGI_KEY_BACKSPACE   259

◆ WXBGI_KEY_COMMA

#define WXBGI_KEY_COMMA   44

◆ WXBGI_KEY_DELETE

#define WXBGI_KEY_DELETE   261

◆ WXBGI_KEY_DOWN

#define WXBGI_KEY_DOWN   264

◆ WXBGI_KEY_END

#define WXBGI_KEY_END   269

◆ WXBGI_KEY_ENTER

#define WXBGI_KEY_ENTER   257

◆ WXBGI_KEY_EQUAL

#define WXBGI_KEY_EQUAL   61

◆ WXBGI_KEY_ESCAPE

#define WXBGI_KEY_ESCAPE   256

◆ WXBGI_KEY_F1

#define WXBGI_KEY_F1   290

◆ WXBGI_KEY_F10

#define WXBGI_KEY_F10   299

◆ WXBGI_KEY_F11

#define WXBGI_KEY_F11   300

◆ WXBGI_KEY_F12

#define WXBGI_KEY_F12   301

◆ WXBGI_KEY_F2

#define WXBGI_KEY_F2   291

◆ WXBGI_KEY_F3

#define WXBGI_KEY_F3   292

◆ WXBGI_KEY_F4

#define WXBGI_KEY_F4   293

◆ WXBGI_KEY_F5

#define WXBGI_KEY_F5   294

◆ WXBGI_KEY_F6

#define WXBGI_KEY_F6   295

◆ WXBGI_KEY_F7

#define WXBGI_KEY_F7   296

◆ WXBGI_KEY_F8

#define WXBGI_KEY_F8   297

◆ WXBGI_KEY_F9

#define WXBGI_KEY_F9   298

◆ WXBGI_KEY_HOME

#define WXBGI_KEY_HOME   268

◆ WXBGI_KEY_INSERT

#define WXBGI_KEY_INSERT   260

◆ WXBGI_KEY_LEFT

#define WXBGI_KEY_LEFT   263

◆ WXBGI_KEY_LEFT_BRACKET

#define WXBGI_KEY_LEFT_BRACKET   91

◆ WXBGI_KEY_MINUS

#define WXBGI_KEY_MINUS   45

◆ WXBGI_KEY_PAGE_DOWN

#define WXBGI_KEY_PAGE_DOWN   267

◆ WXBGI_KEY_PAGE_UP

#define WXBGI_KEY_PAGE_UP   266

◆ WXBGI_KEY_PERIOD

#define WXBGI_KEY_PERIOD   46

◆ WXBGI_KEY_RIGHT

#define WXBGI_KEY_RIGHT   262

◆ WXBGI_KEY_RIGHT_BRACKET

#define WXBGI_KEY_RIGHT_BRACKET   93

◆ WXBGI_KEY_SEMICOLON

#define WXBGI_KEY_SEMICOLON   59

◆ WXBGI_KEY_SLASH

#define WXBGI_KEY_SLASH   47

◆ WXBGI_KEY_SPACE

#define WXBGI_KEY_SPACE   32

◆ WXBGI_KEY_TAB

#define WXBGI_KEY_TAB   258

◆ WXBGI_KEY_UP

#define WXBGI_KEY_UP   265