|
Today we worked together as the entire group for the first time in several weeks. It felt good, too bad the time for the project is basically out and we still couldn’t solve the drawing issues.
Before lunch I pretty much finished as much of the project report i could write before having finished the project. In the afternoon when the rest of the group arrived we all started working on our individual parts of rendering, I worked on drawing out a 2d texture on the screen. Before i stopped working on the HUD i had copied the methods for drawing a single sprite onto the screen from an old save off the example coding we made in Helium during an earlier class.
The process of getting a texture to display on the screen is somewhat complex.
The process begins in game_state which contains a struct called UIElement. This struct contains the following variables:
int shader;
int texture;
int sampler;
int format;
int buffer;
int index;
int blend;
int depth;
float x, y, w, h;
helium::Matrix4 world;
The Game_state contains one instance of this struct named element.
In the Game_state’s initialize function the element’s values is set using a function called construct_element.
In that function instances of the same names as the variables in the element struct are created. They are then used in a function of the render system which saves the variable in the render system’s list of said variables and returns the index number.
this number is the reason why the variables in element is integers named after something else. Later in the Game_state draw method a function called draw_element is called which calls for various functions in the render system to select the needed variables out of it’s internal lists. For example one of the function is select_shader which takes the shader integer of element, this function then goes through the lists of shaders in the render system and selects the one that matches element. Finally it calls for the render system’s draw function which takes a mode variable, in this case TriangleList, and two unsigned integers; one which is zero and one equal to the total amount of vertices, in this case 6.
Somewhere in here is an issue which prevents the image from being drawn. I can’t figure out where the error is or what’s causing it. There might be a variable which is an unsigned int 32 put into a function requiring an int 16 or the error might be in the render system’s drawing function itself.
We came to the conclusion that neither me or Martin who is working on drawing 3D objects would be able to solve the issues alone and decided to schedule an appointment with Tommi tomorrow. Hopefully he will be able to find the issue faster than me or Martin for both our problems.
The one issue that did get resolved today was the one we struggled with yesterday where our text on the screen would only show every 3rd symbol. The issue was solved by complete accident when Martin worked on drawing 3D objects and must have changed something in the settings for the render system or something.
I knew we should have taken care of the drawing issue earlier but I kept assuming it was under control.
I should have inquired more into what the others were doing, dammit. Hopefully we can sort this mess out tomorrow.

|