v2026.11.2
All Bundles
Bundle

OpenGL 3.3 core rendering on top of SDL2. Builds on sdl2.obl for the window and context; this bundle is the GL side. Compile with -lib sdl2.

Layers, thinnest first: GLWindow (window and context), GL (state), Shader, Mesh, Texture2D, Light, RenderTarget, Material, Frustum, ShadowMap, PointShadow, Overlay, Transform, and Box/Scene. All public, so nothing is capped.

Targets the 3.3 core profile, forward-compatible: the highest common denominator across the desktop platforms Objeck ships, since macOS caps at 4.1 core. GLES-only hardware is out of scope by construction.

See docs/opengl.md for setup, a minimal program, why the calls are coarse-grained, and how to add one.

RayHit

What a ray ran into, and where.

Returned by Scene->Raycast. Always an object, never Nil -- ask IsHit rather than checking for Nil, so a miss does not need a different code path from a hit.

The normal is the surface the ray struck, which is what a decal, a ricochet or a spark effect needs to orient itself. For a box it is an axis direction; for a prop it points away from the prop's centre, because a prop is tested against its bounding SPHERE rather than its actual geometry.

Operations

GetBox #

Which box was struck.

method : public : GetBox() ~ Box

Return

TypeDescription
Boxthe box, or Nil when a prop was hit or nothing was

GetDistance #

How far along the ray the hit was, in world units.

method : public : GetDistance() ~ Float

Return

TypeDescription
Floatthe distance, or 0 on a miss

GetNormalX #

method : public : GetNormalX() ~ Float

Return

TypeDescription
Floatx of the surface normal at the hit

GetNormalY #

method : public : GetNormalY() ~ Float

Return

TypeDescription
Floaty of the surface normal at the hit

GetNormalZ #

method : public : GetNormalZ() ~ Float

Return

TypeDescription
Floatz of the surface normal at the hit

GetProp #

Which prop was struck.

method : public : GetProp() ~ Prop

Return

TypeDescription
Propthe prop, or Nil when a box was hit or nothing was

GetX #

method : public : GetX() ~ Float

Return

TypeDescription
Floatx of the point struck

GetY #

method : public : GetY() ~ Float

Return

TypeDescription
Floaty of the point struck

GetZ #

method : public : GetZ() ~ Float

Return

TypeDescription
Floatz of the point struck

IsHit #

Did the ray hit anything?

method : public : IsHit() ~ Bool

Return

TypeDescription
Booltrue when it did

New # constructor

A miss.

New()

New # constructor

A hit. Built by Scene->Raycast; there is no reason to construct one yourself, and no way to change it afterwards -- a result that can be edited after the fact is a result nobody can trust.

New(distance:Float, x:Float, y:Float, z:Float, nx:Float, ny:Float, nz:Float, box:Box, prop:Prop)

Parameters

NameTypeDescription
distanceFloathow far along the ray
xFloatwhere it struck
yFloatwhere it struck
zFloatwhere it struck
nxFloatsurface normal
nyFloatsurface normal
nzFloatsurface normal
boxBoxthe box struck, or Nil
propPropthe prop struck, or Nil