Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

324 Neutral

About Infinity95

  • Rank
  1. If you are using Visual Studio and want your solution filters to reflect the directory structure you should take a look at this post on stackoverflow: How to set Visual Studio Filters for nested sub directory using cmake You can also organise the projects into folders by first enabling solution folders set_property(GLOBAL PROPERTY USE_FOLDERS ON) and then setting them for each project set_target_properties(yourLibraryOrExecutable PROPERTIES FOLDER "Parentfolder/yourLib") Keep in mind that (afaik) these only affect the way your stuff is organized in your solution files and otherwise have no effect on your build.   EDIT: I did not realize this thread was already half a year old when answering, but maybe my information might still be helpful to someone who stumbles across this thread.
  2.   The for loop will never execute because the first condition is always false. 0 > 44 is false.
  3. Infinity95

    Power Up Table Tennis Contest

    I don't know if i will have enough time for this because of my upcoming exams but count me in. I'll give it a try. EDIT: Also, if anyone would like to team up feel free to write me a message. EDIT2: Is this supposed to be multiplayer or vs. AI?
  4. I think choosing with what language you should start depends a lot on how you think. I for example always like to take things apart and study every little detail of it because i want to know how things REALLY work. That's the reason i started learning c++ very early (just after a bit of PHP which didn't help me a lot with c++). If i had gone even lower (assembler) that would've been too much. If you really wan't to learn something then mostly you can pull it off, even if it's frustrating at some points (which it definitely was, lol) but when you finally understand everything it's very satisfying. Another advantage is that if you understand c++ and the concepts of programming that come with it it's really easy to learn new languages, especially higher level languages. It might be hard in the beginning but later you can understand new things a lot easier. If you don't really have the urge to know what's going on in a computer and just want to program i think it would be better to start with something high level so you can get right to the point and program something without having to worry about little details like memory management and stuff.     I don't really see where the problem is. Any modern compiler with a decent pc will compile a rather long program in a matter of 1-10 seconds and it's up and running. Of course if you have to configure the compiler and such it would be .. lets say a bit distracting but in a great number of compilers that i have used you just press f5 or click run and it does all the stuff for you and you just wait a few seconds.
  5. Infinity95

    Make cursor stay in window

      Yeah that's how i re-programmed it now. I just make the normal cursor invisible and get the rest of the input with DirectInput now. What's left now is to make my own curser and display it at the according screen position.
  6. Infinity95

    Ambition, starting from ZERO

    I wouldn't directly start off with making a game without any knowlege. Even pong can be quite hard if you don't know anything at all. And just following tutorials isn't going to get you very far (talking from own experience here). I first tried to do it with that approach but it went horribly wrong. I was frustrated because i didn't understand everything and lots of things went wrong without me knowing why. I would start by learning the basics of any language you prefer. I would recommend something with a rather simple syntax like python to start with. That way you don't have to focus on correct syntax and learning the syntax so much and focus more on how to approach certain problems. Also i recommend you start by programming small algorithms like a sorting algorithm or some text processing algorithm. You can find some good and challenging problems at the Project Euler site. This way you can advance bit by bit and go from small problems to big problems and also start programming/modding a few simple games. This also has the benefit that you'll be satisfied and feel good when you finished a problem. (At least for me it's like that.) Otherwise if you took on too much work/a problem thats just too big for you to handle you'll get frustrated and depending on how eager you are you'll just give up and that's not what you want, right?   Long story short: You can do it! But take it bit by bit so you dont get frustrated and give up!
  7. Hello guys. I'm having some trouble keeping the cursor in my game window. I have the following code which works quite fine: if(GetFocus() == Game::window) { GetCursorPos(&this->cursorPos); ScreenToClient(Game::window, &this->cursorPos); POINT pCopy = this->cursorPos; if(this->cursorPos.x > windowSize.right) pCopy.x = windowSize.right; if(this->cursorPos.x < 0) pCopy.x = 0; if(this->cursorPos.y > windowSize.bottom) pCopy.y = windowSize.bottom; if(this->cursorPos.y < 0) pCopy.y = 0; if(pCopy.x != this->cursorPos.x || pCopy.y != this->cursorPos.y) { ClientToScreen(Game::window, &pCopy); SetCursorPos(pCopy.x, pCopy.y); } } The problem now is that when i go out of the window too quickly with the mouse and click it loses focus. Is there any way to avoid this?
  8. Infinity95

    Programming the right way?

      Or you could save some time and just write in a comment on the same line what the numbers are about. Then you don't have useless variables that could get you confused.     It takes no more time to declare a well-named variable than it does to write in a comment explaining a number, and a well-named variable shouldn't be confusing. Using magic numbers is a terrible habit. I'm sure there are situations where the approach you describe is appropriate, but advocating it as a rule sounds to me like saying that doing cocaine is fine as long as you go jogging afterwards because jogging is healthy, right? It's focusing on the wrong end of the problem.     I never said it should be a rule. Just my opinion. I don't like it when i have variables that are only used once just for the sake of knowing what they are used for. That's what comments are for. If i use them more than once i almost always use variables for them because it's easier to change the value of it. I only have to change one value and not find and replace 3 values. But if the value is only used once in the whole program why not just write it in there and make a small comment. I know it's preference but still i don't like it when there are 'unnecessary' variables.
  9. Infinity95

    Programming the right way?

      Or you could save some time and just write in a comment on the same line what the numbers are about. Then you don't have useless variables that could get you confused.
  10. Infinity95

    project euler problem 03

    I would have to change return NULL; to return num i guess. That should fix it.
  11. Infinity95

    project euler problem 03

    Ah i got it now. Actuall quite easy ;) Just needed a little help to get there.
  12. Infinity95

    project euler problem 03

    So i solved the problem and was looking through other solutions and found this: n = 600851475143 i = 2 while i*i < n: while n%i == 0: n = n / i i = i + 1 print ('answer is', n) I don't really get why this solution works. Can anyone explain this to me?   BTW: This is my solution in c++: #include <iostream> #include <dinput.h> #include <vector> using namespace std; long long largestpfactor(long long num) { double start = sqrt(num); for(int i = start; i > 1; i--) { if((num % i) == 0) { long long div = 2; while(((i % div) != 0) && div < i) { div++; } if(div == i) return i; } } return NULL; } int main() { cout << largestpfactor(600851475143) << endl; while(!GetAsyncKeyState(VK_END)) { } }
  13. Infinity95

    What console are you buying in 2013?

      ^^^^ This! I build my own pc every 2-3 years with the top stuff on the market. On my pc i can play almost everything that interests me and if i really need a controller i can just connect a 360 controller. Also if somehow my Graphics card or something else is too crappy for a game i want to play i can just switch the part out and don't have to buy a new system. Also in most cases the graphics on pc are better and the games can be modded to be even more fun (best example: The Elder Scrolls series). Who needs consoles? :)
  14. Infinity95

    Odd Blending behavior?

    Ok after a night of rest i found the solution to the problem. I had to disable the Depth buffer and then change the zIndex loop to correctly loop through the elements: void Graphics::RenderMenu() { this->devcon->OMSetRenderTargets(1, &this->backbuffer, NULL); ...... for(unsigned int zIndex = 0; zIndex <= 20; zIndex++) { for(unsigned int i = 0; i < Game::MenuManagerPtr->MenuItemPtrs.size(); i++) { if(Game::MenuManagerPtr->MenuItemPtrs[i]->showing && zIndex == Game::MenuManagerPtr->MenuItemPtrs[i]->zIndex) { ..... this->devcon->Draw(4, 0); } } } }
  15. Infinity95

    Share your coding story.

    It all started when i was 13-14 years old. Back then my dad came to me and gave me some books about HTML and CSS and said to me if i learned to do all of the stuff taught in the books he'd buy me more books for more advanced stuff like PHP. So i started and eventually created a few easy websites (with frames at that time. I shudder at the thought that i used frames back then) and as a result got a few more books of my dad. I started writing small dynamic websites with PHP and was very active in a forum related to web development. The biggest thing i ever created for Web stuff was a whole content management system like Joomla (not as good but it had most of the important features). At that time i was 15.   Then i stopped for 1-2 years and was only playing games. I tried to do stuff with c++ a few times in that time but always got frustrated because i didn't get any major results and stopped shortly after. Then after those roughly 1 and a half years i started learning c++ again with a few books my dad bought for me. Now i'm 18 and am still learning but i'm now much better than before. I recently started a new project and am trying to finish it this time. (All previous projects where abandoned because i either didn't have time for it or i was so frustrated of something that i just gave up) But now i'm past some big hurdles and its starting to all make sense. My current project is a 2d Game written in c++ from ground up (only libraries used are D3D sqlite and boost) which i mainly see as a big learning experience. Next year i'm going to finish my Abitur(secondary education final exam) and then go to university and take computer science courses.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!