Search found 38 matches

by dani93
Sun Feb 21, 2010 4:25 pm
Forum: Programming Discussion
Topic: TTF memory vacuum
Replies: 13
Views: 1048

Re: TTF memory vacuum

You render surfaces but you don't free the memory. http://jcatki.no-ip.org:8080/SDL_ttf/SDL_ttf_43.html#SEC43 Quote of the most important part: The caller (you!) is responsible for freeing any returned surface. So I'm supposed to free the surfaces before the program quits? Simple: Free them when yo...
by dani93
Sun Feb 21, 2010 3:25 pm
Forum: Programming Discussion
Topic: TTF memory vacuum
Replies: 13
Views: 1048

Re: TTF memory vacuum

You render surfaces but you don't free the memory.
http://jcatki.no-ip.org:8080/SDL_ttf/SD ... html#SEC43
Quote of the most important part:
The caller (you!) is responsible for freeing any returned surface.
by dani93
Fri Feb 19, 2010 3:18 pm
Forum: General/Off-Topic
Topic: GOD FUCKING DAMNIT
Replies: 18
Views: 1973

Re: GOD FUCKING DAMNIT

In such cases I use "testdisk" on Linux. Maybe "dd" to write an image, depending on what is damaged.
by dani93
Sat Jan 16, 2010 10:57 am
Forum: Programming Discussion
Topic: [SOLVED] Qt4 Custom Window not compiling
Replies: 7
Views: 810

Re: Qt4 Custom Window not compiling

lotios611 wrote:BTW, how long have you been using Qt? I just started, I think that my project's way too ambitious.
I have been using Qt for about half a year. I think it is incredibly easy to learn.
by dani93
Sat Jan 16, 2010 9:57 am
Forum: Programming Discussion
Topic: [SOLVED] Qt4 Custom Window not compiling
Replies: 7
Views: 810

Re: Qt4 Custom Window not compiling

Here's some code: [...] Works perfect for me again. Another reason I don't like Windows... the paths. Although you already corrected the backslashes in the path, I'm quite sure that the spaces are making problems. Don't know how you can avoid such things on Windows, but you could try something like...
by dani93
Sat Jan 16, 2010 9:24 am
Forum: Programming Discussion
Topic: [SOLVED] Qt4 Custom Window not compiling
Replies: 7
Views: 810

Re: Qt4 Help

Thanks! So you solved the problem by just recompiling the project? I have another question though. I'm trying to open a program from within my program. I've looked into QProcess, but none of the examples I've tried work. I have never used QProcess, so I can't tell you much about it. Maybe if you sh...
by dani93
Sat Jan 16, 2010 6:19 am
Forum: Programming Discussion
Topic: [SOLVED] Qt4 Custom Window not compiling
Replies: 7
Views: 810

Re: Qt4 Custom Window not compiling

Works fine for me on Ubuntu with Qt 4.5.2. However there are two bugs in it: 1) You don't allocate memory for saveDialog -> Segmentation fault 2) You don't need to call getSaveFileName and show on saveDialog. getSaveFileName alone is enough. Try recompiling the complete project (also run qmake), thi...
by dani93
Thu Dec 31, 2009 1:51 pm
Forum: Programming Discussion
Topic: Error with File Loading
Replies: 4
Views: 474

Re: Error with File Loading

Your loop is wrong. It should be:

Code: Select all

for (int i = 0; !file.eof(); i++)
{
  std::getline(file, temp[i]);
  std::cout << temp[i] << std::endl;
}
You got a too high index cause you incremented "i" wrong -> segmentation fault
by dani93
Wed Dec 23, 2009 6:38 am
Forum: Programming Discussion
Topic: Portbale compiler?
Replies: 34
Views: 2502

Re: Portbale compiler?

XianForce wrote:Haha. I've always wondered what that was for. Seems completely useless... Unless you have a file that's like huge, maybe...
You don't need to scroll between definition and implementation of a template class. I read about a patch to view different files somewhere...
by dani93
Mon Dec 21, 2009 5:30 pm
Forum: Programming Discussion
Topic: Portbale compiler?
Replies: 34
Views: 2502

Re: Portbale compiler?

Well I've recently been using MSVC++, The debugger is awesome, and the thing I like the most, is side-by-side file editing... To my knowledge that's not in a stable build of CodeBlocks yet. Right click on the tab (with the name of the code file) and choose "split view" -> "vertically...
by dani93
Sat Aug 29, 2009 5:02 pm
Forum: Programming Discussion
Topic: [SOLVED]Help with function poiners.
Replies: 10
Views: 1002

Re: Help with function poiners.

I used g++ with the -Wall flag to compile it. Didn't they stop to develop DevCpp? I'd use something else like gcc/g++, CodeBlocks (with gcc/g++) or VC++ (although I don't like it). Dev-C++ uses GCC (MinGW). I thought it has its own compiler. If it uses MinGW you should be able to activate the -Wall...
by dani93
Sat Aug 29, 2009 2:18 pm
Forum: Programming Discussion
Topic: [SOLVED]Help with function poiners.
Replies: 10
Views: 1002

Re: Help with function poiners.

Nope it says nothing, i use dev cpp. I used g++ with the -Wall flag to compile it. Didn't they stop to develop DevCpp? I'd use something else like gcc/g++, CodeBlocks (with gcc/g++) or VC++ (although I don't like it). Thanks for pointing it out for me, also suggestions about how i could make this i...
by dani93
Sat Aug 29, 2009 1:11 pm
Forum: Programming Discussion
Topic: [SOLVED]Help with function poiners.
Replies: 10
Views: 1002

Re: Help with function poiners.

Thats because you don't call the function.

Code: Select all

Maskz[mask_wearing].Use ();
You forgot the brackets after "Use" and you should use "endl" after cout to make sure everything is printed out.
Isn't your compiler showing a warning "This statement has no effect"?
by dani93
Fri Aug 28, 2009 9:17 am
Forum: Programming Discussion
Topic: C++: Convert Uint32-IP to std::string
Replies: 2
Views: 2139

Re: C++: Convert Uint32-IP to std::string

Damn, just reinvented the wheel...
I already worked a bit with BSD-sockets, but I didn't know WinSock supports this too.
Thanks for that hint.
by dani93
Thu Aug 27, 2009 4:20 pm
Forum: Programming Discussion
Topic: C++: Convert Uint32-IP to std::string
Replies: 2
Views: 2139

C++: Convert Uint32-IP to std::string

Now I'm gonna show you a piece of code I often use with SDLNet. It converts a Uint32-IP-address (like used by SDLNet) to a std::string. I used it in a messenger to display "* nick [192.168.0.x] connected" in the console and GUI (TTF). It's pretty easy if you know how an IP is built up and ...