• What do you need help with? Version 1
    5,001 replies, posted
Threw together a quick function to set any tiles that the player can't see to not be rendered, can anyone look over it and see if there's any faster way? [cpp]void Cluster::Purge( int x, int y ) { int LowestPoint = 0; for( int z = Size.z - 1; z >= 0 && z < Size.z && LowestPoint == 0; z-- ) if( Tiles[x][y][z].IsOpaque() ) LowestPoint = z; if( LowestPoint != 0 ) for( int z = 0; z < LowestPoint && z > 0; z++ ) Tiles[x][y][z].IsVisible = false; }[/cpp]
Are there any APIs or libraries for c++ to be able to get hardware/system information?
The systems API :P Seriously though, I couldn't google one, neither have I heard of one. Depending on the specific information you require there might be cross-platform wrappers, e.g. Boosts boost::thread::hardware_concurrency() that returns the number of hardware-threads available.
[QUOTE=NorthernGate;23972649]Threw together a quick function to set any tiles that the player can't see to not be rendered, can anyone look over it and see if there's any faster way? [cpp]void Cluster::Purge( int x, int y ) { int LowestPoint = 0; for( int z = Size.z - 1; z >= 0 && z < Size.z && LowestPoint == 0; z-- ) if( Tiles[x][y][z].IsOpaque() ) LowestPoint = z; if( LowestPoint != 0 ) for( int z = 0; z < LowestPoint && z > 0; z++ ) Tiles[x][y][z].IsVisible = false; }[/cpp][/QUOTE] Not really. You could eliminate the "LowestPoint" variable (and the unnecessary assignment that goes with it), but the difference is probably only a few clock cycles (i.e. nothing): [cpp]void Cluster::Purge( int x, int y ) { int z = Size.z; while (z-- > 0) { if( Tiles[x][y][z].IsOpaque() ) { break; } } while (z-- > 0) { Tiles[x][y][z].IsVisible = false; } }[/cpp] You could also replace the IsOpaque method with direct access to a variable (like IsVisible), which would save the overhead associated with calling a subroutine. Again, you would never, ever, ever be able to tell the difference.
Any of you guys know of any good online OpenGL tutorials?
[QUOTE=Richy19;23998922]Any of you guys know of any good online OpenGL tutorials?[/QUOTE] The NeHe tutorials used to be good, but they might be outdated now. When I read them they mostly discussed fixed-function pipeline stuff, which is deprecated in the newer OpenGL standards. There are many tutorials in the old style of OpenGL. If a tutorial uses glBegin/glEnd, it's old, and you shouldn't use it.
They're (nehe tutorials) horribly outdated and were pretty terrible in the first place. Don't even bother reading them. [editline]01:42PM[/editline] This is a reasonable reference: [url]http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Chapter-1:-The-Graphics-Pipeline.html[/url]
Does anyone know of any Hadoop libraries for .NET?
[QUOTE=turb_;24003964]Does anyone know of any Hadoop libraries for .NET?[/QUOTE] Something like [URL="http://code.google.com/p/qizmt/"]this[/URL]?
[QUOTE=Pirate Ninja;24005414]Something like [URL="http://code.google.com/p/qizmt/"]this[/URL]?[/QUOTE] Thanks, but not really what I'm looking for. I need something (doesn't matter what it's written in, preferably runs on Windows and Linux) that has a .NET library available for distributed file storage. Maybe there's a better option than Hadoop for what I need?
[QUOTE=turb_;24005525]Thanks, but not really what I'm looking for. I need something (doesn't matter what it's written in, preferably runs on Windows and Linux) that has a .NET library available for distributed file storage. Maybe there's a better option than Hadoop for what I need?[/QUOTE] [URL="http://www.ohloh.net/p/HDFS_NET"]Then maybe this is for you.[/URL]
[QUOTE=Pirate Ninja;24005855][URL="http://www.ohloh.net/p/HDFS_NET"]Then maybe this is for you.[/URL][/QUOTE] Looks fairly sketchy. Not sure I'd want to base my business around it.
Well i don't know if this is exactly related but windows server seems to have a built in DFS system, [URL="http://geekswithblogs.net/jkhines/articles/article-access-dfs-from-.net.aspx"]check this out.[/URL] Edit: Also check [URL="http://kosmosfs.sourceforge.net/"]this [/URL]and [URL="http://technet.microsoft.com/en-us/library/bb727150.aspx"]this[/URL]
Anyone know good tutorials on setting up GLUT, GLEW & SFML on code::blocks?
[QUOTE=Richy19;24006198]Anyone know good tutorials on setting up GLUT, GLEW & SFML on code::blocks?[/QUOTE] 1. Why all of these, sfml should be sufficient!? 2. [LIST=1] [*][url]http://www.sfml-dev.org/tutorials/1.2/start-cb.php[/url] [*][url]http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/[/url] [*][url]http://glew.sourceforge.net/install.html[/url] [/LIST] Use google next time please.
I did use it, i tried various tutorials but none worked and can you us openGL and make 3d graphics with SFML?
[QUOTE=Pirate Ninja;24006294]1. Why all of these, sfml should be sufficient!? 2. [LIST=1] [*][url]http://www.sfml-dev.org/tutorials/1.2/start-cb.php[/url] [*][url]http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/[/url] [*][url]http://glew.sourceforge.net/install.html[/url] [/LIST] Use google next time please.[/QUOTE] Might want to link him to the tutorials on the latest build of SFML ( 1.6 or 2.0 ) than 1.2... [editline]02:32AM[/editline] [QUOTE=Richy19;24006321]I did use it, i tried various tutorials but none worked and can you us openGL and make 3d graphics with SFML?[/QUOTE] Yeah, though it's not very efficient. And you should go into it a bit more than "none worked", there's no way anyone can help you when you're that vague.
Tried linking SFML again but it didn't work so i gave up and tried using the SFML template but when i select the SFML location it says it cant find audio.hpp Any thoughts?
[QUOTE=Pirate Ninja;24005928]Well i don't know if this is exactly related but windows server seems to have a built in DFS system, [URL="http://geekswithblogs.net/jkhines/articles/article-access-dfs-from-.net.aspx"]check this out.[/URL] Edit: Also check [URL="http://kosmosfs.sourceforge.net/"]this [/URL]and [URL="http://technet.microsoft.com/en-us/library/bb727150.aspx"]this[/URL][/QUOTE] I might look into Microsoft DFS. Hopefully Samba can work with it, although it isn't a show stopper if it doesn't
[QUOTE=Pirate Ninja;24006294]1. Why all of these, sfml should be sufficient!? 2. [LIST=1] [*][url]http://www.sfml-dev.org/tutorials/1.2/start-cb.php[/url] [*][url]http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/[/url] [*][url]http://glew.sourceforge.net/install.html[/url] [/LIST] Use google next time please.[/QUOTE] Uh well, SFML will do the windowing, but it won't do GL extension handling. So if the goal was to write OpenGL you want GLEW as well.
[QUOTE=NorthernGate;24006340]Yeah, though it's not very efficient. And you should go into it a bit more than "none worked", there's no way anyone can help you when you're that vague.[/QUOTE] What's not efficient about it?
Hmm I am a bit apprehensive about asking about this as it has probably been asked before. Does anyone here know of any good tutorials for Neural Networking, I get the basic premise and structure but not how to use them and their structure, even a bit of pseudocode would help, I have scoured google and have not found any truly concise tutorials on the subject, most of them seem to be using specific programs made to utilise neural networks. Thanks.
Ok so i followed this guide word by word using the add compiler and linker files method [URL="http://www.sfml-dev.org/tutorials/1.6/start-cb.php"]http://www.sfml-dev.org/tutorials/1.6/start-cb.php[/URL] And tried this code as the guide says to: [CODE]#include <SFML/System.hpp> #include <iostream> int main() { sf::Clock Clock; while (Clock.GetElapsedTime() < 5.f) { std::cout << Clock.GetElapsedTime() << std::endl; sf::Sleep(0.5f); } return 0; }[/CODE] But it just gave me these errors: obj\Debug\main.o||In function `main':| C:\Users\Me\Documents\Code blocks\sfml testtt\main.cpp|6|undefined reference to `sf::Clock::Clock()'| C:\Users\Me\Documents\Code blocks\sfml testtt\main.cpp|9|undefined reference to `sf::Clock::GetElapsedTime() const'| C:\Users\Me\Documents\Code blocks\sfml testtt\main.cpp|10|undefined reference to `sf::Sleep(float)'| C:\Users\Me\Documents\Code blocks\sfml testtt\main.cpp|7|undefined reference to `sf::Clock::GetElapsedTime() const'| ||=== Build finished: 4 errors, 0 warnings ===| Anyone???
Is there a way to have notepad++'s "find results" sync when you edit a file? It is just annoying to have to keep researching when I am making a lot of edits.
I got SFML working (PARTYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY!!!!!!!!!!!!!) I had linked the files with Code::blocks but not with the project its self :P
[QUOTE=Overv;24007150]What's not efficient about it?[/QUOTE] I had never tried it myself, but from seeing other people mess with 3D in SFML and from reading other posts it seems like it's not as fast as it could/should be. As in you probably shouldn't be making a 3D game with it, but that's just what I read so I could be wrong.
[QUOTE=NorthernGate;24015288]I had never tried it myself, but from seeing other people mess with 3D in SFML and from reading other posts it seems like it's not as fast as it could/should be. As in you probably shouldn't be making a 3D game with it, but that's just what I read so I could be wrong.[/QUOTE] SFML doesn't make any assumptions about which OpenGL implementation you use, it only sets up a rendering context. It's as efficient as any other use of OpenGL (but again, it doesn't provide extensions).
I'm trying to read a bitmap file and display the contents in a human readable form in a text file (as an exercise). I've gotten past the headers and to the bmp data, but I use this loop to spew out the info, to little success. [cpp]int c=0; for(int i=data_start; i<size; i++) { if(c >= width) { c = 0; outFile << "[" << (int)memblock[i] << "," << (int)memblock[i+1] << "," << (int)memblock[i+2] << "," << (int)memblock[i+3] << "]" << endl << endl; i += 3; } else { outFile << "[" << (int)memblock[i] << "," << (int)memblock[i+1] << "," << (int)memblock[i+2] << "]" << endl; i += 2; c++; } } [/cpp] But my output is (first two rows of a 10x10 .bmp image in 100,0,0 colour): [quote][0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,100] [0,0,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [100,0,0] [0,0,100,0][/quote] (it should be [100,0,0] 10 times and then the padding of [0,0,0,0] in each paragraph) What's up with my code?
[QUOTE=FerrisWheel;24034652]I'm trying to read a bitmap file and display the contents in a human readable form in a text file (as an exercise). I've gotten past the headers and to the bmp data, but I use this loop to spew out the info, to little success. [cpp]int c=0; for(int i=data_start; i<size; i++) { if(c >= width) { c = 0; outFile << "[" << (int)memblock[i] << "," << (int)memblock[i+1] << "," << (int)memblock[i+2] << "," << (int)memblock[i+3] << "]" << endl << endl; i += 3; } else { outFile << "[" << (int)memblock[i] << "," << (int)memblock[i+1] << "," << (int)memblock[i+2] << "]" << endl; i += 2; c++; } } [/cpp] But my output is (first two rows of a 10x10 .bmp image in 100,0,0 colour): (it should be [100,0,0] 10 times and then the padding of [0,0,0,0] in each paragraph) What's up with my code?[/QUOTE] Windows Bitmap? Are you writing the loader yourself or is memblock[] the output of some library you're using? I think you have too much padding. You need to pad to the nearest multiple of four. For a ten-pixel width image this would be 10*3=30 bytes, and the closest multiple is 32, so you need 2 bytes of padding, not 4. I have a [url=http://github.com/ml32/imghash/blob/master/src/ihash-img.c]working bitmap loader[/url] in an old library I was writing, if some example code would help. The relevant portion is ihash_img_load_bmp().
A question guys. Arrays in C# aren't declared along with their size unlike in C++ where you can do int arr[5]; so I'm wondering what is the difference when used in a struct. I'm assuming if I had a struct in C++ containing only int arr[5]; and made an instance of that struct it would reserve 5*sizeof(int) in memory. How does it work in C# and am I missing something crucial here?
Sorry, you need to Log In to post a reply to this thread.