2D Game Programming

Started by
14 comments, last by njpaul 18 years, 11 months ago
I have a 2D engine i've made, but for some reason, it freezes whenever i try to load a texture. I have 5 classes (so far): cGraphics cSprite cTexture cTextureSprite : cTexture cTextureAnimatedSprite : cTextureSprite I can send who ever wants to help my engine and they can see if they can et it to work. my contacts: AIM: o knuckles 666 o MSN: knuckles_666@msn.com yahoo: evilknuckles666
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Advertisement
I know this isn't exactly what you were asking for, but have you tried stepping through your code with the debugger to see what happens when you try to load a texture? In general, not many people are going to DL your engine to solve your problems (I learned that personally many years ago :) ), and if you haven't already, you definitely need to learn how to use a debugger. It only gets worse from here if you are going to develop an engine, game... . actually any software.

--Vic--

Ensure you're using the right path when calling your texture filenames. If you're
launching your app from your Visual Studio debugger, then set the path within the IDE to properly pick up your resources..

Make sure there's no typos, etc.

Does the debug spew in the IDE reveal anything moments before the "freeze"??

Learn about game programming!Games Programming in C++: Start to Finish
how do i use that debugger everyone is talking about???
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Depends on what IDE you are using. In Visual Studio 6, you start it by simply pressing F5.

If you are not using Visual Studio 6, tell us what you're using and I'm sure someone can help.

Matt Hughson
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
Also I'd would like to know exactly what you mean by "it freezes". Is it an infinite loop kind of regular freeze or is it an access violation or other type of abrupt runtime termination? The nature of the error often tells a lot about where to look for it.
Hack my projects! Oh Yeah! Use an SVN client to check them out.BlockStacker
i'm using .NET

it freezes completely.. nothing responds, i have to go to task manager to close out the program
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Check out the forum FAQ. There are code blocks you can use to cut and paste the offending code onto this forum. It will be difficult to solve your problem unless people can see what is going on.

Also, I'm not sure how much experience you have coding, but you should probably take some time to get familiar with your IDE before starting any kind of large project. Games really aren't the most stable things to debug through an IDE.

If you want to do 2d, then I would suggest looking into a library such as Allegro or SDL. They will make things much easier for you.
i have lots of experience coding with C++ but not really that much in the .NET framework. i don't really want to spend time learning that, not really that important... and i'm not looking for the "easier" way to do things, i want to learn it all the way so i can use it on my own and use different things with it and whatnot.

actually, i just looked at my code again and after i initiate my sprite class, it freezes in the black fullscreen and i have to restart my computer.... it would really be easier for me to send someone my engine and them look at it, it's really big so i can't just take little bigs of it and put it here (not TOO big though to look at and understand)
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
When I run into problems that force me to restart my computer I change the backbuffer width and height to about 500 and set the windowed to true in the presentation parameters. Then run the program and when the error comes up it stops the program and brings up the just in time debugger.

This topic is closed to new replies.

Advertisement