Search found 11 matches
- Wed Aug 19, 2015 12:51 pm
- Forum: Programming Discussion
- Topic: Exceptions
- Replies: 7
- Views: 12208
Re: Exceptions
Thank you very much for the answer, it is much appreciated. Okay, so now I'm confused as shit. Sorry about that, confusing you was not my intention. I'm looking through all projects for the Engine/Toolkit (Win, Linux, MacOS, iOS), and they definitely all have exceptions disabled, yet they are defini...
- Sat Jul 11, 2015 2:18 pm
- Forum: Programming Discussion
- Topic: Exceptions
- Replies: 7
- Views: 12208
Re: Exceptions
Thank you for that note, it clarifies the issue and i pretty much agree with everything you wrote. The problem with disabled excpetions, however, is that your third option, returning an error code(which is, imho, the best one), is not really possible when using standard library containers(or in cons...
- Thu Jul 09, 2015 8:32 pm
- Forum: Programming Discussion
- Topic: Exceptions
- Replies: 7
- Views: 12208
Exceptions
The following is mainly intended as a question to Falco but if anyone else has opinions or suggestions regarding the topic raised I am, of course, most interested in those, too. I decided to ask this when i tuned in a little late to Falcos livestream on Monday, just in time to hear him express a cer...
- Wed Sep 03, 2014 7:24 pm
- Forum: Programming Discussion
- Topic: Memory Usage Optimization
- Replies: 6
- Views: 3463
Re: Memory Usage Optimization
Aside from that, since you're using C++, you may want to supplement excessive use of STL data structures with lighter C alternatives. For instance, if you don't need the extra functionality / overhead of std::vector, use a simple array or custom linked list in its place I am very sorry, but more or...
- Fri Jan 10, 2014 10:12 am
- Forum: Programming Discussion
- Topic: Pointers, seriously.
- Replies: 12
- Views: 7583
Re: Pointers, seriously.
I might be rather late to the party, yet having read this just now i noticed some errors in the explanations and examples which could not be left uncommented and I thought i could point out some pitfalls, too. The second example, at least imho, does not constitute a meaningful use of pointers at all...
- Sat May 18, 2013 10:47 pm
- Forum: Programming Discussion
- Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
- Replies: 6
- Views: 4285
Re: SDL previous keystate system (Only works sometimes?)
I presume you still call your UpdateKeys() and UpdateMouse() methods after invoking SDL_PollEvent()? I was a little unsure about this point, so I checked it(http://sdl.beuc.net/sdl.wiki/SDL_PollEvent) and SDL_PollEvent calls SDL_PumpEvents, so the state of the key array is updated before you even ca...
- Sat May 18, 2013 10:30 pm
- Forum: Programming Discussion
- Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
- Replies: 6
- Views: 4285
Re: SDL previous keystate system (Only works sometimes?)
Well, as far as I can see it, the contents of mPreviousKeys and mCurrentKeys seem to be the same after each call to UpdateKeys(), because you copy the contents after they are updated. You should propably put your memcpy before you call SDL_PumpEvents().
- Sat May 18, 2013 8:29 pm
- Forum: Programming Discussion
- Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
- Replies: 6
- Views: 4285
Re: SDL previous keystate system (Only works sometimes?)
There are various problems with this code, the one that is propably causing your error, as far as I can see, should be this: The pointer returned by SDL_GetKeyState points to an internal array used by SDL, it remains valid during the whole lifetime of your application and is updated at each call to ...
- Fri Apr 19, 2013 6:25 pm
- Forum: Programming Discussion
- Topic: C vs C++ style of interface for hardware abstraction layer
- Replies: 17
- Views: 10596
Re: C vs C++ style of interface for hardware abstraction lay
Fillius, you are Philipp of 2D Retrospectives, right? I tracked you down from your email address! ;) 2D house of terror looks fantastic! We have a few very seasoned DC developers here. We should talk about some Dreamcast code sometime! You are right, I am. Thank you very much for the compliment, it...
- Fri Apr 19, 2013 6:03 pm
- Forum: Programming Discussion
- Topic: C vs C++ style of interface for hardware abstraction layer
- Replies: 17
- Views: 10596
Re: C vs C++ style of interface for hardware abstraction lay
there is a problem with the example provided. You effectively prevent the compiler from optimizing away all temporaries by making your constructors non-trival(because of the debug output). The last published draft of the current C++ Standard dictates that a non-trivial constructor of temporaries mu...
- Fri Feb 01, 2013 8:41 am
- Forum: Programming Discussion
- Topic: C vs C++ style of interface for hardware abstraction layer
- Replies: 17
- Views: 10596
Re: C vs C++ style of interface for hardware abstraction lay
Hi, there is a problem with the example provided. You effectively prevent the compiler from optimizing away all temporaries by making your constructors non-trival(because of the debug output). The last published draft of the current C++ Standard dictates that a non-trivial constructor of temporaries...