• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=thf;31707169]I think you can do something like: [cpp]class MyClass { public: MyClass(Vector3 position=Vector3(0, 0, 0), float angle=0.0f); }[/cpp] Also you forgot the ; at the end of the class declaration.[/QUOTE] awesome, thanks. And I just wrote that example into the reply box, it's not copied from any actual code.
Has anyone got any experience with hardware instancing?
[QUOTE=thf;31664916]You could just declare a variable like this private in the class: [cpp] sf::RenderWindow& window_; [/cpp] And then in the constructor you use an initializer list like so: [cpp] MyClass::MyClass(sf::RenderWindow window) : window_(window) { // ... } [/cpp] And then you can use it just like the other reference to it: [cpp] window_.Draw(sprite_); [/cpp][/QUOTE] Please excuse my incompetence, but I have no idea what that is doing. So you make a private reference to window_ in MyClass, construct MyClass with sf::RenderWindow window, and set the window_ pointer to window? It would be very helpful if you could explain that a little bit more. And doesn't making the sf::RenderWindow window in the constructor make it necessary to explicitly tell MyClass to draw to x RenderWindow? For example: [code] MyClass Object(RenderWindowName <<Don't I need to explicitly tell it the window name here?>>); [/code]
[QUOTE=kidwithsword;31708101]Please excuse my incompetence, but I have no idea what that is doing. So you make a private reference to window_ in MyClass, construct MyClass with sf::RenderWindow window, and set the window_ pointer to window? It would be very helpful if you could explain that a little bit more. And doesn't making the sf::RenderWindow window in the constructor make it necessary to explicitly tell MyClass to draw to x RenderWindow? For example: [code] MyClass Object(RenderWindowName <<Don't I need to explicitly tell it the window name here?>>); [/code][/QUOTE] You need to pass it the RenderWindow object, yes. [cpp] sf::RenderWindow renderWindow(.......VideoMode and stuff go here........); MyClass Object(renderWindow); [/cpp] You could solve this with a pointer too if you wanted too.
I've been working through Riemer's 3D tutorials and I've come across a big problem, when i try to load an .fx file it never sees it. Is there something I'm missing or...? [URL=http://imageshack.us/photo/my-images/109/unledltx.png/][IMG]http://img109.imageshack.us/img109/1526/unledltx.th.png[/IMG][/URL] The picture was too big.
If you imageshack.us, do it properly and embed the direct link. Can't see shit.
[QUOTE=WeltEnSTurm;31711216]If you imageshack.us, do it properly and embed the direct link. Can't see shit.[/QUOTE] Or much more preferably use another host.
Ah im sorry, here's a different picture. [image]http://robam.co.uk/Junk/cap.png[/image]
Afaik you need an asset name, which should be the same as the name you have in your code. In this case, "effects". [editline]13th August 2011[/editline] If I remember correctly. Was a while ago I messed with XNA.
[QUOTE=Robbis_1;31712399]Afaik you need an asset name, which should be the same as the name you have in your code. In this case, "effects". [editline]13th August 2011[/editline] If I remember correctly. Was a while ago I messed with XNA.[/QUOTE] Makes sense, I'll go try it out now, thanks. [editline]13th August 2011[/editline] Hmm now I'm getting this weird error... [code]Error loading "effects". File contains Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectContent but trying to load as Microsoft.Xna.Framework.Graphics.Effect.[/code] I'm using the effect file here, [url]http://users.telenet.be/riemer/files/effects.fx[/url]. From the Riemers tutorials
I'm getting strange errors with SFML. For some reason, this guy made the change from SFML 1.6 to SFML 2 git in the arch linux repository. I compile a test file and I get linker errors. I switch the GetEvent() function to PollEvent() as a test and find that it doesn't give me a linker error, but it says that there's no member function called PollEvent(). I compile the test file below with this: [code] g++ -o testfile testfile.cpp -lsfml-window -lsfml-system [/code] [cpp] #include <SFML/Window.hpp> int main(int argc, char *argv[]) { bool running = true; sf::Window app(sf::VideoMode(800,600,32), "my window"); while(running) { sf::Event event; while(app.GetEvent(event)) { if(event.Type == sf::Event::KeyPressed) if(event.Key.Code == sf::Key::Escape) running = false; } app.Display(); } } [/cpp]
[QUOTE=Niteshifter;31720783]I'm getting strange errors with SFML. For some reason, this guy made the change from SFML 1.6 to SFML 2 git in the arch linux repository. I compile a test file and I get linker errors. I switch the GetEvent() function to PollEvent() as a test and find that it doesn't give me a linker error, but it says that there's no member function called PollEvent(). I compile the test file below with this: [code] g++ -o testfile testfile.cpp -lsfml-window -lsfml-system [/code] [cpp] #include <SFML/Window.hpp> int main(int argc, char *argv[]) { bool running = true; sf::Window app(sf::VideoMode(800,600,32), "my window"); while(running) { sf::Event event; while(app.GetEvent(event)) { if(event.Type == sf::Event::KeyPressed) if(event.Key.Code == sf::Key::Escape) running = false; } app.Display(); } } [/cpp][/QUOTE] First, you [b]should[/b] use PollEvent in SFML 2.0. Second, are you sure you are using the 2.0 version of the include files?
C++ is just wrecking my brain. Basically, I am writing a relay server. UDP data will be arriving from multiple servers then will be sent out to clients connected via TCP (WebSockets). I'm trying to use the Boost asio libraries, but I'm so inexperienced with C++ that I just can't get anywhere. Anyone any ideas for another language which might be easier to understand but is still capable of this (will be heavy heavy traffic going in and out, will need to be cross-compatible with windows/linux too)
[QUOTE=Jimbomcb;31726120] Anyone any ideas for another language which might be easier to understand but is still capable of this (will be heavy heavy traffic going in and out, will need to be cross-compatible with windows/linux too)[/QUOTE] Any language with a networking library can do this, your bottleneck will be I/O anyway.
Well I don't really have experience in many languages, just wondering if anyone can point me to one that is a bit simpler than c++ and would be a good place to start.
C#, Python, Java maybe?
[QUOTE=Jimbomcb;31726459]Well I don't really have experience in many languages, just wondering if anyone can point me to one that is a bit simpler than c++ and would be a good place to start.[/QUOTE] C# is a language that's easy to learn, has some decent networking libraries out there and is cross-platform, with mono.
Thanks guys.
I haven't done anything programming related in months, ugh. I feel like I'm starting all over again. I'm going through a few of my books, and I'm just trying the code from some programs to get back in the hang of it. Anyone can recommend other exercises I can do to get me back into the game?
I'm quite a newbie in programming, but I have some problems with my Half-Life2 mod that wasn't there before, And I cant figure out what it is. If I run it with debug dlls, it says the client.dll is a debug build (Yes, I have tried to use -allowdebug, but then it just crashes). If I run it with release dlls, it crashes or says: setuparrayprops_r: array prop '(null)' is at index zero. I don't know if this has something to do with it but it is an error to: when I try to start debugging, this shows up: [img]http://img52.imageshack.us/img52/8564/unled27f.png[/img] Then, when I press yes it starts, but then this shows up: [img]http://img703.imageshack.us/img703/3967/unled28s.png[/img] In the Output, this shows up: [code]1>------ Build started: Project: Client Episodic, Configuration: Debug Win32 ------ 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(D:\Program Files (x86)\Steam\steamapps\sourcemods\-----------\src\game\client\.\Debug_episodic\Client Episodic.dll) does not match the Linker's OutputFile property value (D:\Program Files (x86)\Steam\steamapps\sourcemods\-----------\src\game\client\Debug_episodic\Client.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(Client Episodic) does not match the Linker's OutputFile property value (Client). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 1> client_episodic-2005.vcxproj -> D:\Program Files (x86)\Steam\steamapps\sourcemods\-----------\src\game\client\.\Debug_episodic\Client Episodic.dll ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========[/code] also I checked in the folder where the Client Episodic.dll should be, but it isn't there.
Does anyone have a clue why, for whatever reason, do TCP UNIX sockets work fine and dandy in my application on Windows (cygwin), but fail with a "Connection reset by peer" error after sending a few bytes on some Linux distributions? The code can be found [url=https://github.com/SergeB/libsteam]here[/url], and the bug can be reproduced by compiling and executing libsteam-test with two bogus parameters. [url=https://github.com/SergeB/libsteam/blob/master/src/Steam2/serverclient.c]Here I am creating and using the sockets[/url] [url=https://github.com/SergeB/libsteam/blob/master/src/Util/socketutil.c]Here are some helper functions I use in the process[/url] edit: disregard that, I suck cocks, forgot "unsigned long" is 64-bit in some gcc versions, so I didn't talk with the server correctly.
Could anyone help me out with setting up a basic framework for android to render images ? I am not completly retarded, I know I have to render a 2 triangles and then set the texture to that but I'm just a bit confused on how to set that up and on how to do it properly. If anyone is interested please send me a pm so I can add you on a IM client like skype or steam. Thanks in advance.
In XNA, is there anyway I can store keyboard Keys in a simple .txt. XmlSerializer doesn't get along with anything that implements IDictionary and it's sooo easy to store my controls in a Dictionary
Is anyone having problems running this? It runs fine for me, but when my girlfriend tries to run it, it says something about re installing the application. It's just a simple game, [url]http://dl.dropbox.com/u/36610581/Guess_My_Number_Project.rar[/url] .
[QUOTE=Werem00se;31729559]Is anyone having problems running this? It runs fine for me, but when my girlfriend tries to run it, it says something about re installing the application. It's just a simple game, [url]http://dl.dropbox.com/u/36610581/Guess_My_Number_Project.rar[/url] .[/QUOTE] Nope, works perfectly... made it in 3 guesses :D
[QUOTE='[CPC] Halvor;31730145']Nope, works perfectly... made it in 3 guesses :D[/QUOTE] Haha, well then. I don't have any clue why it's not working for her. Would for some reason you need VC++ on your computer to run it? If so, I think that may be the problem.
[QUOTE=Werem00se;31730224]Haha, well then. I don't have any clue why it's not working for her. Would for some reason you need VC++ on your computer to run it? If so, I think that may be the problem.[/QUOTE] You need the VC++ Runtime to run it, whatever version you compiled it for.
[QUOTE=thf;31722980]First, you [b]should[/b] use PollEvent in SFML 2.0. Second, are you sure you are using the 2.0 version of the include files?[/QUOTE] Oddly, it is the 2.0 version.
How do I make this automatic letter replacement thing go away? It's really annoying. The image is tabbed for huge. [t]http://dl.dropbox.com/u/36610581/help.jpg[/t]
Press the insert key.
Sorry, you need to Log In to post a reply to this thread.