Search found 164 matches
- Tue Jul 31, 2012 7:19 pm
- Forum: Programming Discussion
- Topic: This is really frustrating[Solved][SDL_SurfaceVectors]
- Replies: 7
- Views: 2815
Re: This is really frustrating (SDL_Surface vectors?)
I wasn't sure if you could have a vector of pointers. You can have a vector of whatever you want, but pointers won't be properly destroyed when the vector is destroyed, cleared, or when an element is erased. As to that, you did say use a smart pointer if I wanted to make a vector of SDL surface's, ...
- Tue Jul 31, 2012 1:57 pm
- Forum: Programming Discussion
- Topic: GarbageCollector freezes
- Replies: 7
- Views: 2195
Re: GarbageCollector freezes
Glad that it worked for you.
Educating the world about good pointer management seems to be my niche. *dons a cape and flies away*
Educating the world about good pointer management seems to be my niche. *dons a cape and flies away*
- Mon Jul 30, 2012 11:02 pm
- Forum: Programming Discussion
- Topic: This is really frustrating[Solved][SDL_SurfaceVectors]
- Replies: 7
- Views: 2815
Re: This is really frustrating (SDL_Surface vectors?)
What YourNerdyJoe said about your push_back is also correct. I don't understand why you're making an array of one vector of SDL_Surface auto_ptr. That [1] is extremely unnecessary; it's about on par with "a = a;" on the unnecessary meter. Using straight auto_ptr will not work. auto_ptr wil...
- Mon Jul 30, 2012 10:42 pm
- Forum: Programming Discussion
- Topic: GarbageCollector freezes
- Replies: 7
- Views: 2195
Re: GarbageCollector freezes
What type of error message are you getting when it crashes? Are you sure it's not crashing in the Entity destructor? If you're using any reasonably recent compiler (at least Visual Studio 2010, GCC 4.6, or Clang 2.9 with libc++ if you want to avoid iffy behavior) you could use std::shared_ptr instea...
- Mon Jul 30, 2012 6:52 pm
- Forum: Programming Discussion
- Topic: This is really frustrating[Solved][SDL_SurfaceVectors]
- Replies: 7
- Views: 2815
Re: This is really frustrating (SDL_Surface vectors?)
There's a whole lot of code here and only one line has anything to do with the problem. I'd suggest fixing that. Inferring what I can from that one line and the build log, it looks like surface_vect is defined like this: std::vector<SDL_Surface>* surface_vect; There's a few problems with this: 1. Th...
- Mon Jul 30, 2012 6:35 pm
- Forum: Programming Discussion
- Topic: GarbageCollector freezes
- Replies: 7
- Views: 2195
Re: GarbageCollector freezes
I don't think the problem is with the code shown here, then. If you can create a sufficiently reduced version of the problem and would be comfortable sharing it, I could take a closer look.
- Mon Jul 30, 2012 3:22 pm
- Forum: Programming Discussion
- Topic: GarbageCollector freezes
- Replies: 7
- Views: 2195
Re: GarbageCollector freezes
What do the locals look like when you step through this in a debugger? What is bIt->data.ptr when it crashes? If you step into the delete, is the issue the destructor? Try reducing the problem as much as possible (probably in a separate project), then walking through the entire execution of the test...
- Thu Jul 26, 2012 5:55 pm
- Forum: General/Off-Topic
- Topic: Parsing HTML with RegEx
- Replies: 4
- Views: 2120
Re: Parsing HTML with RegEx
Lmfao.. the Pochahontas bit killed me. That, and the fact that the answers is rated 5 stars "Very Informative". I seriously hope for the sake of all of us that the OP was kidding when he asked that though.. I can't imagine he was serious. It's Yahoo! Answers, there are no limits to the st...
- Thu Jul 26, 2012 2:19 am
- Forum: Game Development
- Topic: Nam: A C++ Asset Management Library
- Replies: 5
- Views: 2647
Re: Nam: A C++ Asset Management Library
I'm curious, from the WIKI I am unsure how one would be utilize NAM. Could you post an example of what benefit it is providing you? From the basic usage tutorial, it seems you write a class that writes and reads a file, and it returns to you, the user, a shared_ptr<T> (T is the type you just wrote)...
- Wed Jul 25, 2012 2:27 pm
- Forum: Programming Discussion
- Topic: MSVCR90.dll isn't found {was:[Solved] C++ File Inclusion :(}
- Replies: 26
- Views: 8182
Re: C++ File Inclusion :(
I'm using SDL. How do I make it so that it doesn't have black boxing when resizing? Wherever you're pumping SDL_Events: if (ev.type == SDL_VIDEORESIZE) { // ... use data in ev.resize ... } ev is an SDL_Event , ev.resize is an SDL_ResizeEvent . I don't think there is a way to eliminate the black box...
- Wed Jul 25, 2012 12:51 pm
- Forum: Programming Discussion
- Topic: MSVCR90.dll isn't found {was:[Solved] C++ File Inclusion :(}
- Replies: 26
- Views: 8182
Re: C++ File Inclusion :(
On a side note. Does anyone know how to detect a window resize event for Microsoft Windows? And handle them. WM_SIZE message: LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { // ... case WM_SIZE: { // If you anticipate sizes of more than 65535, use GetC...
- Tue Jul 24, 2012 9:15 pm
- Forum: Game Development
- Topic: Nam: A C++ Asset Management Library
- Replies: 5
- Views: 2647
Re: Nam: A C++ Asset Management Library
Alright, I fixed it somewhat. There's a bug that causes shit to go crazy if the nam::store is cleared/destroyed before all of its nam::shared_ptrs, which I'm working on now. Aside from that, it's usable as far as I'm aware. I got pissed at my previous asset manager last night and got rid of the whol...
- Tue Jul 24, 2012 8:17 pm
- Forum: Game Development
- Topic: Nam: A C++ Asset Management Library
- Replies: 5
- Views: 2647
Nam: A C++ Asset Management Library
Hi, I got pissed at my previous asset manager last night and got rid of the whole damn thing. So I wrote a small, extensible asset management template library using C++11 to replace it. It's very RAII friendly and I thought some of the folks on here might find it useful. It's on GitHub at http://git...
- Tue Jul 24, 2012 7:39 pm
- Forum: Game Development
- Topic: HOW MANY Programming Languages have YOU learned?
- Replies: 26
- Views: 12492
Re: HOW MANY Programming Languages have YOU learned?
I'm going to include markups in the list for the sake of completeness. Expert C++ (8 years) C (8 years) PHP (7 years) HTML (7 years) CSS (7 years) XML (7 years) Make (GNU syntax) (6 years) Objective C (2 years) Proficient Delphi (8 years) BASIC (various flavors) (8 years) JavaScript (7 years) SQL (7...
- Tue Jul 24, 2012 7:17 pm
- Forum: Programming Discussion
- Topic: MSVCR90.dll isn't found {was:[Solved] C++ File Inclusion :(}
- Replies: 26
- Views: 8182
Re: C++ File Inclusion :(
Don't use a singleton. If your subsystems need a way to access the engine, give them a pointer or a reference. Better yet, isolate what parts of the engine they need access to (other subsystems, etc) and only give them pointers/references to those. Something like this would work: Engine.hpp: #pragma...