Search found 75 matches

by bnpph
Wed Mar 16, 2011 1:23 pm
Forum: Programming Discussion
Topic: Problem Copying SDL_Surfaces
Replies: 10
Views: 954

Re: Problem Copying SDL_Surfaces

To fix the colors, just change RGB to BGR. Windows is backwards that way. Do not know why copy isn't working - could you post more code? But anyway, I do not get why you are using SDL surfaces with OpenGL. Why do you need them? If you need an image loader, you can always use something like DevIL or ...
by bnpph
Tue Mar 15, 2011 7:11 pm
Forum: Programming Discussion
Topic: [SOLVED] .NET vs C languages
Replies: 66
Views: 6261

Re: [SOLVED] .NET vs C languages

Except that Java or C# require that C++ be faster than them. Ever notice the JVM is written in C++? Yeah, some of the JIT might make it almost the same speed, but because of the nature of a VM, C++ must execute faster than the language it's interpreting. That's not exactly true, as JIT is not inter...
by bnpph
Tue Mar 15, 2011 4:01 pm
Forum: Programming Discussion
Topic: strange c behavior (aliasing rule, solved)
Replies: 12
Views: 1144

Re: strange c behavior [solved, pretty sure anyways]

yes, if you use the url pointer to point to some allocated memory you dont have to, just make sure that you dont over write the bounds. cause it will most likely corrupt the stack.
I think you mean heap ;)
by bnpph
Tue Mar 15, 2011 3:45 pm
Forum: Programming Discussion
Topic: strange c behavior (aliasing rule, solved)
Replies: 12
Views: 1144

Re: strange c behavior

What's your compiler? Command line?

It's probably due to some strict aliasing rule. You can either disable it, or get around it with unions or gcc/intel attribute "__may__alias__"
by bnpph
Tue Mar 15, 2011 2:15 pm
Forum: Current Events and Science/Technology
Topic: Your PC is Learning!
Replies: 8
Views: 2522

Re: Your PC is Learning!

Guard your airlocks.
by bnpph
Tue Mar 15, 2011 2:11 pm
Forum: Programming Discussion
Topic: [SOLVED] .NET vs C languages
Replies: 66
Views: 6261

Re: [SOLVED] .NET vs C languages

Utterly ridiculous, I wasn't going to post a reply because I at least half agree with most of your points but this is just wrong. Java/c# code becomes obsolete faster because they are proprietary. They are updated fairly regularly which can make code in previous versions unsafe eg when generics and...
by bnpph
Tue Mar 15, 2011 1:04 pm
Forum: Programming Discussion
Topic: [SOLVED] .NET vs C languages
Replies: 66
Views: 6261

Re: [SOLVED] .NET vs C languages

I'm sorry, but Java, C#, and JIT compiled languages are never going to fully replace C/++, just as C/++ will never (and cannot possibly) completely replace assembly. No, it never will fully replace. However, Java/C# are going to become the next "general purpose" language of choice, and wi...
by bnpph
Mon Mar 14, 2011 11:46 pm
Forum: Programming Discussion
Topic: [SOLVED] .NET vs C languages
Replies: 66
Views: 6261

Re: [SOLVED] .NET vs C languages

Your logic is all over the map. New languages are not faster than old languages. New languages simply accelerate development. C/C++ is only falling out of favor in corporate business setups where high level logic reigns supreme over meticulous optimization. ? I shall explain myself better. Assembly...
by bnpph
Mon Mar 14, 2011 9:18 pm
Forum: Programming Discussion
Topic: [SOLVED] .NET vs C languages
Replies: 66
Views: 6261

Re: [SOLVED] .NET vs C languages

10 years ago it was how Java was not suitable replacement for C++. Eventually, java will run faster than C++. 20 years ago it was how C++ was not suitable replacement for C. Now, C++ can run faster than C. 30 years ago it was how C was not suitable replacement for assembly. Now, C can run faster tha...
by bnpph
Sun Mar 13, 2011 6:03 pm
Forum: Programming Discussion
Topic: Learning a porly docummented library
Replies: 4
Views: 1295

Re: Learning a porly docummented library

Read through opensource sources that use library.

You could start out reading through grrlib.
by bnpph
Sun Mar 13, 2011 3:08 pm
Forum: General/Off-Topic
Topic: Probability Question
Replies: 6
Views: 1192

Re: Probability Question

Here is how I solved it - I am sure there is a better way. I first found probability of success incrementing or decrementing. Then I found chance of rolling 4 dice (for example, rolling 2 + and 2 -) Then I found number of times the result could be found (for example, 3+ 1- can be: +++-, ++-+, +-++, ...
by bnpph
Sat Mar 12, 2011 12:30 am
Forum: Programming Discussion
Topic: A polymorphism question
Replies: 26
Views: 3209

Re: A polymorphism question

RTTI data is stored within a class's vtable as a pointer to an RTTI metadata object (called type_info). This metadata object must store the name of the class so at very least it is growing linearly by a byte in size with each character of the class name. IMO I don't think the few extra bytes matter...
by bnpph
Thu Mar 10, 2011 6:00 pm
Forum: Programming Discussion
Topic: A polymorphism question
Replies: 26
Views: 3209

Re: A polymorphism question

Heya GyroVorbis! I have very little experience with c++'s RTTI, and so I may be entirely wrong on the subject, but I do not understand some things you have said: First of all that typeid() grows linearly with the length of the class name. It also grows linearly with the depth of the inheritance tree...
by bnpph
Thu Mar 10, 2011 2:39 pm
Forum: Programming Discussion
Topic: A polymorphism question
Replies: 26
Views: 3209

Re: A polymorphism question

Hello Khearts. I think it is best idea to split into 2 seperate arrays. The only benefit I can see to having 1 single array is that it preserves ordering of insertion, and may be sorted. If you do not need either of these, then 2 arrays is preferred method. If you want to iterate through every objec...
by bnpph
Thu Mar 10, 2011 2:00 pm
Forum: General/Off-Topic
Topic: Official "Hello, World! (I'm new!)" thread
Replies: 821
Views: 595734

Re: Official "Hello, World! (I'm new!)" thread

Hello!
My name is Sven, and I enjoy C++, listening to music, and drawing images.

I like to watch Elusion Shadows videos on youtube, and also I like to watch video game movies.

P.S.
This smiley face is funny :shock2: