[QUOTE=Doom;37515861]Ah thanks a lot :)
The reason why I didn't do that is because I get 11, to be quite specific. My guess was that you simply couldn't have several switch statements ^^[/QUOTE]
Not in a way that would be simple. You could reduce duplicated code by having the if statements set a value that you format into the string, something like this:
[csharp]int points = 0;
if (radioButtona.Checked)
points += 1;
//...
MessageBox.Show(string.Format("You gained {0} affection points!", points));[/csharp]
going to attempt to learn c++ what do I need a compiler text editor and debugger? i haven't the faintest
Get Visual Studio 2010.
thanks
Do all of these gl helper libraries and multimedia frameworks have a delay when opening a window? It's the most annoying think to me to see SDL_app or GLFW Window and a white screen for a second before the title of the application window actually gets changed. Why does this occur? Does anyone here have experience with getting rid of this issue?
[QUOTE=Parakon;37516806]going to attempt to learn c++ what do I need a compiler text editor and debugger? i haven't the faintest[/QUOTE]
you could use code::blocks
[QUOTE=amcfaggot;37518275]Do all of these gl helper libraries and multimedia frameworks have a delay when opening a window? It's the most annoying think to me to see SDL_app or GLFW Window and a white screen for a second before the title of the application window actually gets changed. Why does this occur? Does anyone here have experience with getting rid of this issue?[/QUOTE]
I only get this issue when running with a debugger attached.
Hi,
I have a little problem doing some math in C++
The problem is simple, but it has kept me going for a few days now.
Basically, I am trying to calculate this: 2^t, where the user of the program fills in a value of t, however it just keeps giving me 1 as answer.
How the code is build up:
[QUOTE]
int t;
long double d = pow(2, t);
cin >> t >> endl;
cout << d << endl;
[/QUOTE]
(With all the other, proper working things stripped from it, of course.)
Anyone that could help me out on this one?
cin should be before long double.... and after int t;
Otherwise t is unitialized, also, I dont think you should have endl; in cin, but I could be wrong.
You are powering t before you get it from standard input.
Ah yes! It works properly now! Thanks a lot!
[QUOTE=jung3o;37512894]I think I've seen somewhere in this sub forum that they don't like python. I would be nice if why python is bad because I just started learning it and if i should stop and learn something else.[/QUOTE]
Many Facepunchers seem biased towards low-level imperative languages. Python is a bit higher level than C++ and that stuff.
Is there any reason why glGetBufferParameteriv would segfault only on the second time it runs? It goes fine the first time, but then it just segfaults on the second call to it.
Also, running it through GDB doesn't cause a segfault. What the fuck is happening? It just suddenly stopped working.
[QUOTE=WTF Nuke;37515004]Depends on what you're doing.[/QUOTE]
Sorry I am being dumb, basically it is an OpenGL program and most of the things (assuming that OpenGL ES can run on a computer) functions in the same way. The notable differences are input and image loading used for textures.
[QUOTE=AlienCat;37522892]Sorry I am being dumb, basically it is an OpenGL program and most of the things (assuming that OpenGL ES can run on a computer) functions in the same way. The notable differences are input and image loading used for textures.[/QUOTE]
AFAIK, OpenGL ES is just a subset of OpenGL.
I'm trying to compile some code I downloaded, but it keeps throwing this error up
[code]fatal error LNK1104: cannot open file 'LIBCD.lib'[/code]
whats the deal
[QUOTE=Parakon;37523676]I'm trying to compile some code I downloaded, but it keeps throwing this error up
[code]fatal error LNK1104: cannot open file 'LIBCD.lib'[/code]
whats the deal[/QUOTE]
[url]http://lmgtfy.com/?q=fatal+error+LNK1104%3A+cannot+open+file+%27LIBCD.lib%27&l=1[/url]
[QUOTE=Richy19;37523707][url]http://lmgtfy.com/?q=fatal+error+LNK1104%3A+cannot+open+file+%27LIBCD.lib%27&l=1[/url][/QUOTE]
lmgtfy is bannable, just saying.
[QUOTE=Richy19;37523707][url]http://lmgtfy.com/?q=fatal+error+LNK1104%3A+cannot+open+file+%27LIBCD.lib%27&l=1[/url][/QUOTE]
I already googled it, what I got from the results just caused me more errors
I feel lmgtfy is justified his exact problem is answered in the first result from that search
[QUOTE=Richy19;37523913]I feel lmgtfy is justified his exact problem is answered in the first result from that search[/QUOTE]
Regardless of if that is true or not, it's still an asshole reply to give when you could just say something like "the first result on google for <query here> should help you" or whatever.
Figured it out with another link that had a different method so richy's a butte
[QUOTE=Parakon;37525140]Figured it out with another link that had a different method so richy's a [B]butte[/B][/QUOTE]
I have no idea what that means
[QUOTE=Richy19;37525197]I have no idea what that means[/QUOTE]
[t]http://upload.wikimedia.org/wikipedia/commons/3/39/Monument_Valley_Merrick_Butte.jpg[/t]
Anyway, debugging is a pain in the ass when the crash disappears if a debugger is attached.
I want to make switches and doors in my game, and other similar stuff that is connected in a way.
My entity class has a pointer to an entity, so I can "connect" them, however I am not sure how to efficiently save that connection when I save the map data to a file. And then how to load it from a file, and set those pointers right when the game loads.
Here is an example how 2 entities(tiles) data is stored in a text file:
[code]
-999 501 -999 -999 0
576 32 256 512 2 0 0 1 1 0 Data\Textures\World\bg2.png 0 0 0 0 0 0 0 1 1 0 0 0 0 0 # 255 255 255 255
-999 501 -999 -999 0
960 -32 256 512 2 0 0 1 1 0 Data\Textures\World\bg4.png 0 0 0 0 0 0 0 1 1 0 0 0 0 0 # 255 255 255 255
[/code]
How would you do it ?
You'll need to give each item a unique ID. Then after you spawn all entities on re-load, run a PostSpawnInit() function that searches the entity list for the stored uniqueID.
This gets dicey when you start adding/deleting entities, or changing anything's unique ID.
I got ninjad there as well.
[QUOTE=ECrownofFire;37525263]
Anyway, debugging is a pain in the ass when the crash disappears if a debugger is attached.[/QUOTE]
Yeah, it is annoying, happens to me every time.
[QUOTE=ECrownofFire;37525263]Anyway, debugging is a pain in the ass when the crash disappears if a debugger is attached.[/QUOTE]
Oh yes, I love [URL="http://en.wikipedia.org/wiki/Heisenbug"]Heisenbugs[/URL].
[QUOTE=ECrownofFire;37525263]Anyway, debugging is a pain in the ass when the crash disappears if a debugger is attached.[/QUOTE]
Probably have some memory errors (ex: bool Foo; if(Foo) {DoStuff();}), if you're on Linux you can easily spot them using Valgrind. Not sure of any alternatives for Windows though.
[QUOTE=Naelstrom;37527583]Probably have some memory errors (ex: bool Foo; if(Foo) {DoStuff();}), if you're on Linux you can easily spot them using Valgrind. Not sure of any alternatives for Windows though.[/QUOTE]
DrMemory is probably the closest.
Sorry, you need to Log In to post a reply to this thread.