04-25-2018, 12:46 AM
(This post was last modified: 04-25-2018, 01:52 PM by Brian Beuken.)
ok since you sent me the code I had a quick look and its a bit of a mess, why do you have multiple build configurations? It looks like you have an MSbuild config but not properly set up.
Because of this strange mix of MSBuld and GNU I can't actually get your project to run
Can I suggest you scrap this, start a new project and this time be careful to select GNU make...
Other issues, well you have a pragama once in your code in the cpp file, you should only put them in .h files.
in your Files to transfer you are mixing separators, you use ; for the 1st 5 or 6 then a ,
you can't mix them,
GNU make wants to see ;
MSbuild wants to see ,
In your Main loop here, do you see that you are trying to draw, something BEFORE you load it? The book does say to load it after the Filehandler
There's an important typo too, when you try to find the address of a_position attribute, ..see if you can find that
Something else to look at in the main loop, once you move that texture creation to just after FileHandler, what happens to the value we store in p_state->user_data->textureID .....if a few lines later we
init p_state
have a think...
But for sure, create a new project, I dunno what the exact cause is for the multiple configs and semi msbuild stuff, but it is confusing, so much quicker to start again and just copy your files into the new GNU Make Project.
I've fixed your project here, but I really want you to try to locate the issues, so let me know tomorrow if you need me to send this back to you as a working version.
Because of this strange mix of MSBuld and GNU I can't actually get your project to run
Can I suggest you scrap this, start a new project and this time be careful to select GNU make...
Other issues, well you have a pragama once in your code in the cpp file, you should only put them in .h files.
in your Files to transfer you are mixing separators, you use ; for the 1st 5 or 6 then a ,
you can't mix them,
GNU make wants to see ;
MSbuild wants to see ,
In your Main loop here, do you see that you are trying to draw, something BEFORE you load it? The book does say to load it after the Filehandler
There's an important typo too, when you try to find the address of a_position attribute, ..see if you can find that
Code:
int main(int argc, char *argv[])
{
UserData user_data;
bcm_host_init(); //RPI needs this
esInitContext(p_state);
uint width, height;
//graphics_get_display_size(0, &width, &height);
//init_ogl(p_state, width, height);
init_ogl (p_state, 720, 720);
p_state->user_data = &user_data;
MyFiles FileHandler;
if (!Init(p_state))
return 0;
esRegisterDrawFunc(p_state, Draw);
//now do the graphic loop
esMainLoop(p_state);
int Width, Height;
char* OurRawData = FileHandler.Load((char*)"../Assets/Lenna.png", &Width, &Height);
if (OurRawData == NULL) printf("The thing didnt load\n");
p_state->user_data->textureId = CreateTexture2D(Width, Height, OurRawData);
}
Something else to look at in the main loop, once you move that texture creation to just after FileHandler, what happens to the value we store in p_state->user_data->textureID .....if a few lines later we
init p_state
have a think...
But for sure, create a new project, I dunno what the exact cause is for the multiple configs and semi msbuild stuff, but it is confusing, so much quicker to start again and just copy your files into the new GNU Make Project.
I've fixed your project here, but I really want you to try to locate the issues, so let me know tomorrow if you need me to send this back to you as a working version.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's