Search found 1052 matches
- Sat Jun 01, 2013 7:07 pm
- Forum: Programming Discussion
- Topic: Are you kidding me, Java?
- Replies: 14
- Views: 10877
Re: Are you kidding me, Java?
It certainly looks insane, but the reason it is that way is so you can do something like: System.out.println("x = " + x); and have it print out something sensible in all cases, including where x is null. There is no value of x other than null where that line ought to fail (all objects have...
- Fri May 10, 2013 8:32 pm
- Forum: Programming Discussion
- Topic: SDL Segmentation fault (core dumped)
- Replies: 3
- Views: 3327
Re: SDL Segmentation fault (core dumped)
Segmentation faults are caused by dereferencing an invalid pointer (typically NULL). My guess in this case is that it fails to load "bmp.bmp", which would leave spriteSheet uninitialized (it could be anything, including NULL), then when you try to use it in apply_sprite() it crashes.
- Sun Feb 24, 2013 8:40 am
- Forum: Programming Discussion
- Topic: c++ grandmaster certification
- Replies: 10
- Views: 7810
Re: c++ grandmaster certification
I enrolled today. I feel quite certain that the course will eventually be too difficult for me to handle, but until then I'm doing it.short wrote:the first course preview was posted today, with a github link to download the skeleton code.
http://www.cppgm.org/pa1.html
- Wed Jan 23, 2013 6:39 pm
- Forum: Game Development
- Topic: My Year Project
- Replies: 5
- Views: 4997
Re: My Year Project
Make a demo. It doesn't have to be big, it doesn't have to be pretty, but it has to show some functionality of the game, whether it's player animation or camera panning or a whole battle system. After you make each bit of functionality that you consider interesting, make another demo. Every so often...
- Wed Jul 25, 2012 4:31 pm
- Forum: Programming Discussion
- Topic: Using Modulo to get a chance of higher than 50%
- Replies: 7
- Views: 4563
Re: Using Modulo to get a chance of higher than 50%
Given some random unsigned integer x, you can do things like this:
You can use other comparisons as well, but these are basic and useful.
Code: Select all
if(x%y == z) // gives a 1/y chance
if(x%y < z) // gives a z/y chance
if(x%y >= z) // gives a (y-z)/y chance
- Wed Jul 11, 2012 7:49 pm
- Forum: Programming Discussion
- Topic: Lazy Foo SDL tutorial # 23 [help me plz]
- Replies: 7
- Views: 4482
Re: Lazy Foo SDL tutorial # 23 [help me plz]
<ofstream> is one of many standard C++ headers, and if any compiler doesn't support it (I'm sure MSVC++ does), it's an incomplete C++ implementation. Regarding your bug, I see no reason why you should be surprised by that behavior; it's exactly what you programmed it to do. Nowhere do I see the prog...
- Sat Jun 30, 2012 10:46 pm
- Forum: Programming Discussion
- Topic: Ideas, stoopid code, and friends
- Replies: 14
- Views: 6259
Re: Ideas, stoopid code, and friends
Change the line
to while() instead.
As it is, your program processes at most one event per frame, while the OS and the user are quite happy to throw a few more at it during that time. while() ensures that the event queue empties each frame.
Code: Select all
if( SDL_PollEvent( &event ) )
As it is, your program processes at most one event per frame, while the OS and the user are quite happy to throw a few more at it during that time. while() ensures that the event queue empties each frame.
- Sun Jun 10, 2012 7:57 pm
- Forum: Programming Discussion
- Topic: Dreamcast DDEr4 png example undefined references
- Replies: 9
- Views: 5274
Re: Dreamcast DDEr4 png example undefined references
A quick google search of "_gzopen" seems to indicate that your problem appears to have been encountered before, here . The post immediately after it offers an explanation and solution. I don't know if it will solve your problem, but here it is: It has to do with wfont and the romdisk not g...
- Mon Jun 04, 2012 9:27 pm
- Forum: Game Development
- Topic: I NEED A TEACHER!!!!!
- Replies: 13
- Views: 5344
Re: I NEED A TEACHER!!!!!
You need to access the channel #elysian_shadows. This tutorial should help.
- Mon Jun 04, 2012 9:27 pm
- Forum: Game Development
- Topic: loading a .bmp file into SDL
- Replies: 44
- Views: 12134
Re: loading a .bmp file into SDL
Yes I knw how 2 spell I just choose not 2.....I rlly need help with programming plz don't be a Dick and help me...... First, do not insult our intelligence by intentionally making yourself seem stupider than you claim to be. If you don't at least try to spell things correctly, there is no way in he...
- Mon Jun 04, 2012 5:12 pm
- Forum: Game Development
- Topic: I NEED A TEACHER!!!!!
- Replies: 13
- Views: 5344
Re: I NEED A TEACHER!!!!!
To get (useful) assistance on this forum, I'd recommend you provide three things: A description of what your program is supposed to do A description of what it currently does (if it's graphical, pictures help, if not, terminal output helps) Your source code, within tags. It would be even better if y...
- Sun Jun 03, 2012 9:07 pm
- Forum: Programming Discussion
- Topic: [SOLVED]Looking to make 3d games with opengl, but don't
- Replies: 8
- Views: 3903
Re: Looking to make 3d games with opengl, but don't know how
It looks like you have some linker errors. In Lazyfoo's Tutorial 1, it should tell you pretty thoroughly how you need to set up your environment in order to compile and run SDL.
- Fri May 25, 2012 10:55 pm
- Forum: Programming Discussion
- Topic: Are you kidding me?
- Replies: 18
- Views: 7746
Re: Are you kidding me?
I can see where this would be beneficial if you had a 1 to 1 ratio of if..else's replacing try...catch blocks, but what if you had several if...elses that would be in a block of code where one try...catch could take care of it? Wouldn't many if..else's be more expensive than one try...catch? Absolu...
- Fri May 25, 2012 9:23 am
- Forum: Programming Discussion
- Topic: Are you kidding me?
- Replies: 18
- Views: 7746
Re: Are you kidding me?
So my assumption is incorrect? Its the Try...catch that actually causes that behavior instead of the actual error itself? Every language has its own idea of exactly how exceptions should work, so C++ doesn't require you to use them. In C, which never had exceptions anyway, developers often indicate...
- Thu May 24, 2012 9:51 pm
- Forum: Programming Discussion
- Topic: Are you kidding me?
- Replies: 18
- Views: 7746
Re: Are you kidding me?
I think I get what you are saying but, it would be nice to see a snippet of code as an example. Take, for example, the OutOfMemoryException of the original post. If you program runs out of memory, you probably want do one of two things: a) make a mad dash to free up some unnecessary memory or b) di...