Files
ghostty/pkg/opengl/main.zig
Mitchell Hashimoto eccd07f009 pkg: replace @cImport with addTranslateC in pkg/
@cImport is going to disappear in Zig 0.17. Its deprecated in Zig 0.16.
Let's remove it now.

Replace @cImport with addTranslateC across pkg/ packages. Each
package now has a c_import.h header that is translated at build
time via addTranslateC and exposed as a "cimport" module import.

Converted packages:
- dcimgui
- fontconfig
- freetype
- glslang
- harfbuzz
- macos
- oniguruma
- opengl
- sentry
- spirv-cross
- wuffs

Omitted:
- gtk4-layer-shell - This has a bit more complexity with how it
  interacts with GTK headers, so I need to consider this a bit more.
- src/ - It'll be cleaner to do this separately.
2026-04-16 21:35:51 -07:00

46 lines
1.7 KiB
Zig

//! OpenGL bindings.
//!
//! These are purpose-built for usage within this program. While they closely
//! align with the OpenGL C APIs, they aren't meant to be general purpose,
//! they aren't meant to have 100% API coverage, and they aren't meant to
//! be hyper-performant.
//!
//! For performance-intensive or unsupported aspects of OpenGL, the C
//! API is exposed via the `c` constant.
//!
//! WARNING: Lots of performance improvements that we can make with Zig
//! comptime help. I'm deferring this until later but have some fun ideas.
pub const c = @import("c");
pub const glad = @import("glad.zig");
pub const ext = @import("extensions.zig");
pub const Buffer = @import("Buffer.zig");
pub const Framebuffer = @import("Framebuffer.zig");
pub const Renderbuffer = @import("Renderbuffer.zig");
pub const Program = @import("Program.zig");
pub const Sampler = @import("Sampler.zig");
pub const Shader = @import("Shader.zig");
pub const Texture = @import("Texture.zig");
pub const VertexArray = @import("VertexArray.zig");
pub const errors = @import("errors.zig");
pub const Primitive = @import("primitives.zig").Primitive;
const draw = @import("draw.zig");
pub const blendFunc = draw.blendFunc;
pub const clear = draw.clear;
pub const clearColor = draw.clearColor;
pub const drawArrays = draw.drawArrays;
pub const drawArraysInstanced = draw.drawArraysInstanced;
pub const drawElements = draw.drawElements;
pub const drawElementsInstanced = draw.drawElementsInstanced;
pub const enable = draw.enable;
pub const disable = draw.disable;
pub const frontFace = draw.frontFace;
pub const pixelStore = draw.pixelStore;
pub const viewport = draw.viewport;
pub const flush = draw.flush;
pub const finish = draw.finish;