[QUOTE=ZeekyHBomb;42165695]It might be that it's included via <>and gcc silently accepts that, or tcc does not include the current path when including with "".
Anyway, to work around whatever the issue is, add CFLAGS=-I<path-to-jim-win32compat.h> to the configure invocation.[/QUOTE]
I'm not sure what has been going on, but for some reason, it started to do the same thing in gcc as well. Even after re-cloning the repository into a new directory and rerunning the configure and make commands.
Anyway, your solution with setting the CFLAGS environment variable helped me out, so thanks a ton!
Does anyone here have experience with Microsoft Visual Studio 2010 C++?
I'm having a compiling error that seems unsolvable.
I'd like to evaluate if I'm able to help you even though it's been a while since I've used MSVC. Can you be more specific?
Well it's fixed now but at this point I'd consider it a riddle. I've lost the error it would give me, but I'm just considering this case an oddity.
Basically what happened:
Installed program, program opened cleanly, wrote code, it wouldn't compile.
Googled the problem, every other link had people saying "Looks like you configured your project wrong" (which I knew I wasn't).
Try weird solutions (changing linker libraries, uninstall .network 4.5 and download 4) which did nothing.
Clean install, didn't work.
Clean install, didn't work.
Clean install, worked.
Computers have become so complex, they're essentially non-deterministic machines ;)
There's some famous computer scientist who said something alike. Just so you know it's true.
Jep.
Zeeky out.
I need some win32 Python 3.3 help:
I wrote a small loopback service that keeps a dictionary and lets other processes edit and retrieve it more or less atomically. (Probably less, due to lacking Python experience.)
What I want to do is move the interface to a named pipe that only accepts connections from the current user. It [i]should[/i] be possible with the [URL="http://starship.python.net/~skippy/win32/Downloads.html"]Win32 Extensions[/URL], but I have not the slightest clue how how to set it up and get a stream for each new connection.
Does anyone know how to do this or where I can find example code? I have a [I]very[/I] fuzzy idea how to create the pipe thanks to [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365590%28v=vs.85%29.aspx"]this[/URL], but how do I get the streams and start new threads for each connection without global variables everywhere?
Right, I'm hopping from different sound libraries because I always get confused by coding with audio stuff. I've tried GStreamer and Portaudio, and now I'm trying OpenAL, but I'm close to giving up on this one as well because I don't understand a thing.
The problem is that I'm a beginner, and I don't fully understand everything about pointers ("oh hey this guy has an asterisk before its name oh hey this other guy has an asterisk after its name what is happening"). I've read information about pointers, but on the page I read from cplusplus.com I couldn't find any info about an asterisk after its name. Either that, or I'm blind.
Could someone please write an example code which generates a sine wave using any of these audio libraries and put a reasonable amount of comments in it? I fancy a good example more than understanding things from the ground up.
You should probably get a C++ book and just care about its exercises for a while :D
Anyway, when declaring stuff, the asterisk belongs to the type. Otherwise it's an operator:
[code]int *a; //pointer to int
int* b; //pointer to int
int * c; //pointer to int
const int *d; //const pointer to int
int const *e; //const pointer to int
int *const f; //pointer to const int
const int *const g; //const pointer to const int
int const *const h; //const pointer to const int[/code]
The differentiation when the pointer is const or the variable it is pointing to is const depends on whether it stands before or after the asterisk; if before, the pointer is const, if after, then the variable is const.
You can read the type "backwards", so that "* const" becomes const pointer (const then *), and "const *" becomes pointer to const (* then const).
When used in an expression it dereferences the pointer, meaning it gets the actual variable, not the memory location:
[code]int *a;
//a = 5; //error: cast from int to pointer
*a = 5; //okay: *a gets the int at the address a is pointing to and assigns 5 to it
int *b = a; //b points to the same variable as a
int c = *a; //c has the same value as the variable pointed to by a, but is a different variable[/code]
Then there's the ampersand-operator, which takes the address of something:
[code]int a;
//int *b = a; //error: const from int to pointer
int *b = &a; //okay: b stores the address of a[/code]
That might be a bit much to take in at once. If you're having trouble imagining what exactly pointers are, a book (and probably also some Internet tutorials, but in general I would recommend getting a book) have some illustrations to clarity the concept.
[IMG]http://i.imgur.com/UU8Sjly.png[/IMG]
How am I going to make sure the thing to spawn only spawns in the spawning field, and not in the playing field?
The field's center is (0, 0)
I'd like to spawn it around the edge, minus some offset, so I have better control over the speed at which they get to the center.
[editline]13th September 2013[/editline]
This feels trivial but my brain isn't working.
Get a random angle, use that to do a ray-box intersection against the playing field with the ray starting at 0, 0 and pointing to the random angle.
Then move the intersection-point by the bounds of the object and spawn it there.
[QUOTE=ZeekyHBomb;42175006]You should probably get a C++ book and just care about its exercises for a while :D
Anyway, when declaring stuff, the asterisk belongs to the type. Otherwise it's an operator:
[code]int *a; //pointer to int
int* b; //pointer to int
int * c; //pointer to int
const int *d; //const pointer to int
int const *e; //const pointer to int
int *const f; //pointer to const int
const int *const g; //const pointer to const int
int const *const h; //const pointer to const int[/code]
The differentiation when the pointer is const or the variable it is pointing to is const depends on whether it stands before or after the asterisk; if before, the pointer is const, if after, then the variable is const.
You can read the type "backwards", so that "* const" becomes const pointer (const then *), and "const *" becomes pointer to const (* then const).
When used in an expression it dereferences the pointer, meaning it gets the actual variable, not the memory location:
[code]int *a;
//a = 5; //error: cast from int to pointer
*a = 5; //okay: *a gets the int at the address a is pointing to and assigns 5 to it
int *b = a; //b points to the same variable as a
int c = *a; //c has the same value as the variable pointed to by a, but is a different variable[/code]
Then there's the ampersand-operator, which takes the address of something:
[code]int a;
//int *b = a; //error: const from int to pointer
int *b = &a; //okay: b stores the address of a[/code]
That might be a bit much to take in at once. If you're having trouble imagining what exactly pointers are, a book (and probably also some Internet tutorials, but in general I would recommend getting a book) have some illustrations to clarity the concept.[/QUOTE]
Alright then, I feel a bit more connected to pointers now. I guess playing around with Assembly in GMod wasn't all that bad, heh.
But I still have no example of a sine wave generator. I have found a program which does it without a library [url=http://pastebin.com/f7ANgL8N]here.[/url] The only problem with it is that I can't find a way to pipe it to ALSA or my soundcard. That's why I saw an audio library as a possible solution.
Try
[code]./yourprogram | aplay[/code]
[QUOTE=ZeekyHBomb;42177472]Try
[code]./yourprogram | aplay[/code][/QUOTE]
That's exactly what I did. It works, but it won't work for what I'm planning to do. My application has everything except the sound generation part. Allow me to explain:
I have made a program which allows the user to choose a note between three octaves, and then the program automatically plays that note continously until the user Ctrl-C's the application. (In Linux, Ctrl-C kills the application running in the foreground in the terminal)
I've got everything down except the actual sound generation, as stated before.
Works for me, albeit a bit of crackling, which might be due to ALSA -> PA; works loads better with pacat.
I don't get it - did you make a sine wave generator in C++ or did you just pipe the output of the code example I gave above?
I took the code from pastebin you posted.
Oh, I see now - the basic idea of what I want to do is to make that piece of code (or others) not cout like on line 22 from the pastebin I posted; instead, send it directly to the sound card or something. I don't seem to have any audio device in /dev, so I figured that I'd need an audio library. Either that, or another way to make it output sound. I'm clueless on this, so I'm asking you guys for help.
Well, OpenAL is certainly one way to do it. iirc you can setup a callback to fill a buffer with new sounds.
E.g. using ALURE you can use [url=http://kcat.strangesoft.net/alure-docs/files/stream-cpp.html#alureCreateStreamFromCallback]alureCreateStreamFromCallback[/url].
I've been using ALURE + OpenAL in my game engines and have been quite successful, feel free to ask me questions about it supervoltage.
Here's my fairly simple audio wrapper: [url]https://github.com/naelstrof/invictus/blob/master/src/audio.cpp[/url]
You'll mainly care about is::Audio::init() so you can initialize OpenAL and a listener. From there you can create your own methods of creating sound buffers and sound objects. (Mine are probably overly complex due to loading not only via lua but through a virtualized filesystem :u)
Do you guys know about any free and open audio libraries, that isn't OpenAL? (Since OpenAL wasn't _really_ open and free)
[QUOTE=ZeekyHBomb;42181263][url=http://kcat.strangesoft.net/openal.html]OpenAL Soft[/url]?[/QUOTE]
I forgot that that even existed, yet I didn't actually ever bother to look it up. It seems that it has some activity going for it still, which is always a good sign!
Thanks a ton, again!
Making a C++ text based game at the minute. I want it to have a graphical interface, as in, I'd like to color texts, and put scenes behind the text etc to give it some sort of atmosphere as well as sounds.
What would I use to do this and how would I go about it? Is there any tutorials? All of the art will be done so I don't need to do it myself, I need it imported and then have the text on like a pallete when going into a conversation. It's hard to explain but imagine a final fantasy dialog box, and then the graphics on screen are basically an animation of the scene?
Is this hard to do?
I'm just doing text based at the minute and learning a lot more, but eventually I'd like to do that ^. Is it best to start now?
[editline]14th September 2013[/editline]
Like, it'd be an animation of sorts, here, I'll try to demonstrate in shitty paint picture.
[thumb]http://puu.sh/4qCa4.png[/thumb]
or just imagine pokemon in the way the dialog pops up and disappears, but with a pixelated animation in the background.
Would this be hard to do?
Also, I'm not doing the art. (Thank god).
If you are going for completely console graphics then use ncurses. Otherwise if you want a little more than that like subcells, 32bit colors and transparency then go for the libtcod library.
Or you could just use sfml, which would be a lot easier for graphical stuff, and it has its own sound library too.
I need help setting up Codeblocks, the compiler isn't working apparently. I've installed it though, C/C++ Intel Compiler.
Hey,
Im fairly good at C#, My Aunt runs a small company and needs some software to give to customers that would simply allow them to put a logo onto it and move it around on a 3D sort of T-shirt, trousers or other such model, i am unsure how to go about getting a model to be displayed on a C# form.
Anyone could help me? that would be great!
Does anybody know where I can get GWEN for Ubuntu?
[QUOTE=nuttyboffin;42188995]Hey,
Im fairly good at C#, My Aunt runs a small company and needs some software to give to customers that would simply allow them to put a logo onto it and move it around on a 3D sort of T-shirt, trousers or other such model, i am unsure how to go about getting a model to be displayed on a C# form.
Anyone could help me? that would be great![/QUOTE]
Does it have to be 3D? You could probably just make 2D representations of each side of the shirt/pants (including sides).
Otherwise you're going to have to look into OpenGL or DirectX with some decal projections.
[QUOTE=Erasus;42189089]Does anybody know where I can get GWEN for Ubuntu?[/QUOTE]
Isn't it cross-platform?
[editline]14th September 2013[/editline]
[QUOTE=nuttyboffin;42188995]Hey,
Im fairly good at C#, My Aunt runs a small company and needs some software to give to customers that would simply allow them to put a logo onto it and move it around on a 3D sort of T-shirt, trousers or other such model, i am unsure how to go about getting a model to be displayed on a C# form.
Anyone could help me? that would be great![/QUOTE]
WPF can do some basic 3D relatively easily, you just can't use shaders or normal maps.
Quick question:
I'm currently at the Beehive Managing part of Headfirst C#, but when I do this;
[code] public bool AssignWork(string job, int numberOfShifts) {
for (int i = 0; i < workers.Length; i++);
if (workers[i].DoThisJob(job, numberOfShifts))
return true;
else
return false;
}[/code]
the 'i' in the if statement doesn't exist in the current context, so I'm not sure what the book is doing with this.
Further along it says I need a get or set accessor for a private int they use in another method, but adding in a get or set accessor and then using the public version still says I need a get or set accessor. If someone has read this book before how did you fix this?
Sorry, you need to Log In to post a reply to this thread.