Files
ghostty/pkg/opengl/main.zig
Chris Marchesi fe9cf6a266 build: fully transition away from cImport/addTranslateC
This migrates all remaining uses of cImport (and addTranslateC for good
measure) to using translate-c for C translation, ensuring that we are
ready for when cImport is removed from the language, and also that all
sources of C translation are using the same snapshot of the external
package (when can then be updated when we need to fix something).

A couple of notes:

* A few options have been added to support the new translations, namely
  the ability to link libraries (passed through to linkLibrary on the
  Translator side) and whether or not to initialize default values
  (looks like cImport did this without a way to control it, but
  translate-c does not do it by default).

* Using the new library linking option actually simplifies the process
  of translating a number of the C packages as we have been shipping the
  necessary headers for these packages already with the applicable
  libraries. For some of the more complex translation processes though,
  we still include the appropriate directories directly.
2026-09-15 11:01:24 -07:00

48 lines
1.8 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("opengl_c");
pub const glad = @import("glad.zig");
pub const egl = @import("egl.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 readPixels = draw.readPixels;
pub const pixelStore = draw.pixelStore;
pub const viewport = draw.viewport;
pub const blitFramebuffer = draw.blitFramebuffer;
pub const flush = draw.flush;
pub const finish = draw.finish;