Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
What renders over what
Browse files Browse the repository at this point in the history
  • Loading branch information
corwinn committed Feb 4, 2023
1 parent be3f687 commit f57e880
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 1 addition & 3 deletions engines/render_gl/h3r_renderengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ static bool global_render_gl_init {false};
RenderEngine::RenderEngine() : RenderEngine {H3R_MAX_SPRITE_NUM} {}
RenderEngine::RenderEngine(GLsizeiptr max_sprite_frames)
{
//TODO then figure out little z-offsets (relative) for each control
// (f(z-order) so the entire UI shall be rendered in one gl call
// GL_DEPTH_TEST; and compare to the above; choose the less-code one
//LATER RenderEngine::UI ().ChangeZOrder ()

H3R_ENSURE(global_render_gl_init, "You forgot to call RenderEngine::Init()")

Expand Down
9 changes: 6 additions & 3 deletions engines/render_gl/h3r_renderengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ using H3Rfloat = GLfloat;
// project shall be able to use some of the best renderers out there - I know
// you want to play multi-dimensional "Heroes III"; patience.
//
// Right now the z-order equals the order of UploadFrame() it seems; although
// I'm not sure how Open GL orders things, with equal z coordinates, inside VBO.
//TODO R&D the topic.
// Right now the z-order equals the order of UploadFrame(), because that's what
// glMultiDrawArrays passes to the pipeline.
// The z-order, if it becomes a requirement, shall be implemented via a z
// coordinate: {x,y,u,v} shall become {x,y,z,u,v}; with the ability to modify
// said z coordinate per key. The map window: the map control shall be defined
// 1st by the map window, so it will be rendered prior everything else.
class RenderEngine final
{
// Bind texture id to glMultiDrawArrays. Because frame0 could be at
Expand Down
4 changes: 2 additions & 2 deletions project
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ should they've just published the original source code.
A few things:
* UI - there are a few forms and dialogs - nothing to re-discover because most
of them are pre-rendered pictures that just need hit rectangles
* rendering - z-order, shadow and opacity maps, sprite atlases - nothing new
here; alpha blending is nowhere to be found yet
* done: rendering - z-order, shadow and opacity maps, sprite atlases - nothing
new here; alpha blending was "found" :) (at fonts)
* game: a 3D table of quad patches: n*n*l, where n=18,36,72,144 and l=1,2
- quad: layered: terrain, river, road, objects, visibility (per kingdom);
also, the game does some kind of patch blending:
Expand Down
4 changes: 2 additions & 2 deletions ui/h3r_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class Control
private: Box _bb; // bounding box
private: bool _enabled {true}; // whether the user can interact with it

private: List<Control *> _z; // z-order; render: from 0 to count-1
private: List<Control *> _n; //LATER non-visible ones; if any
//LATER RenderEngine::UI ().ChangeZOrder ()
private: List<Control *> _n; // Sub-controls; could be useless
private: void Add(Control *);

public: Control(Control * = nullptr);
Expand Down

0 comments on commit f57e880

Please sign in to comment.