Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Any example projects for Tier 2 available for learning?

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 23rd Nov 2017 21:33
Are there any example projects available for getting a hang of the Tier 2 programming?

I've just finished porting my Basic project to Visual Studio. I've gone over all the functions and I'm not getting any compile issues or warning but upon building the app, I'm experiencing exception errors.

I'm checking my arrays (as pointed out by another user) but chances are the issue might lie somewhere in declaration of variables that store 3D object IDs upon import.

For example this is how I've declared and imported a texture:
Quote: "
UINT spr_beta_sprite;
void app::Begin(void)
{
spr_beta_sprite = agk::LoadImage("media/textures/test_bricks.png"); // load the beta sprite
}
"


I don't know if it's the correct or wrong way to declare an import a texture but Visual is not complaining so I'm not sure.
Are there any C++ example projects available to take a look at to see how it's done?
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 24th Nov 2017 18:54
I would suggest using agk::SetErrorMode(2); before loading anything as AppGameKit will skip
loading the image/object if the directory or name is not correct without throwing an error.

You may also want to think about error catching like checking if the file exists first before loading.

The coffee is lovely dark and deep,and I have code to write before I sleep.
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 25th Nov 2017 00:04 Edited at: 25th Nov 2017 00:09
Thanks Stab.

I've actually ended up commenting out everything and trying to pinpoint the source of the issue by re-adding code blocks one by one. I've ended up finding the issue to be the dynamic array inside of a "for" loop. I'm creating an array before the main loop with a single slot and in the loop of the begin function, I'm writing data to it and expanding the array by 1 at the end. Not sure which causes the issue, the expansion or the data writing. I'm suing the C++ default Array function though. I'll try to use the STL libreary instead this time, maybe it'll work. Will be trying to figure out the solution tonight. I'm so close god dammit.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Nov 2017 20:34
I had converted SpaceShooter from tier1 to tier2.
maybe it will help you a bit.

FORUM LINK
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 26th Nov 2017 03:51
Ah, thanks MadBit.

I've gotten it to work. All's good in the hood. Thanks for the link
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net

Login to post a reply

Server time is: 2024-11-24 12:58:47
Your offset time is: 2024-11-24 12:58:47