Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Visual C++/Open Gl Help

Options
  • 09-11-2007 5:50pm
    #1
    Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭


    Hi, just starting to use visual C++ and open gl and I want to make a game, like asteroids or tetris or something.
    I'm looking at examples like http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=46958&lngWId=1
    but I can't figure out how to run his game. Do I have to make it into an exe? No? I take it I am meant to open Visual C++ and run it from there? Do you open all the files and compile them? Ok, I try to compile it and it says it can't find an exe. So if I call my project asteroid.exe it says it can't find that in my project folder.
    Thanks,
    --
    Tar


Comments

  • Registered Users Posts: 1,931 ✭✭✭Zab


    A quick look at the page reveals that it was written in VB6!


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Lol, yeah, oops, althought it did come up when I googled visual c.
    How come it compiles! :-)


  • Registered Users Posts: 2,379 ✭✭✭toiletduck


    I know you're in NUIG, I think i may be in the same lecture as you... I'm going with asteroids.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    You probably are then, Ill probably do asteroids as well, unless he lets me do pong!
    Share notes. :P


  • Registered Users Posts: 3,165 ✭✭✭DEmeant0r


    I will be doing a one level mario type thing, hopefully :D


  • Advertisement
  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Oooh cool, sounds hard!
    If we all do asteroids this should be easy ;)


  • Registered Users Posts: 2,379 ✭✭✭toiletduck


    My gf suggested pong aswell! I'm going to go with asteroids but do away with the annoying ufos.


  • Registered Users Posts: 515 ✭✭✭NeverSayDie


    You may find this site useful if you're looking for OpenGL intros:
    http://nehe.gamedev.net
    Tutorials are pretty old at this stage, but they're still a good introduction.

    Depending on your specs, you might be better off looking into using C# and the XNA platform - it'll make it considerably quicker to get up to speed, and avoid a lot of hassle in coding the framework of your app.


  • Registered Users Posts: 378 ✭✭sicruise


    It seems like a very tough assignment for someone who seems to have never programmed before!

    OpenGL is a great low level graphics libary that is not only very powerful but is platform independant.

    But for you starting out not knowing the diff between vb and c++ I would seriously recommend using http://www.ogre3d.org/ so you don't have to worry about the windows/linux programming side of things.

    There are plently of open source tools out there to be utilised...

    btw... yes you do have to compile it :confused:


  • Registered Users Posts: 1,481 ✭✭✭satchmo


    Ogre is complete overkill for something like this, especially for someone who's never programmed before. Even using OpenGL isn't really necessary (unless required by your lecturer) and would probably just make things more difficult. Learn the basics first and then progress to 3D.

    Go with SDL and start simple. Make a program that can open a window and clear it to a particular colour. Then learn how to load an image file and display it in the window as a sprite. Then learn how to use keyboard input to move the sprite around the screen. After that, you'll have everything you need to make a simple game.

    There are plenty of SDL tutorials around for learning how to do all this and more. Here's one that linked from the SDL tutorials page and seems to be clear and easy to follow.


  • Advertisement
  • Registered Users Posts: 2,379 ✭✭✭toiletduck


    satchmo wrote: »
    Even using OpenGL isn't really necessary (unless required by your lecturer)

    It is. It's this or a VRML model with Javascript.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Yes, we have to make a 2d game using opengl.
    Never programmed before?
    Heh. I admit I did make a rather stupid mistake.

    Anyway, I'm not putting in the ufos either.


  • Registered Users Posts: 2,379 ✭✭✭toiletduck


    Mine will have a twist in the end where you find out that you are the ufo :eek: That's got to worth something.

    Eek, better get started!
    You may find this site useful if you're looking for OpenGL intros:
    http://nehe.gamedev.net
    Tutorials are pretty old at this stage, but they're still a good introduction.

    Cheers, looks like it'll come in handy.


  • Registered Users Posts: 1,481 ✭✭✭satchmo


    toiletduck wrote: »
    It is. It's this or a VRML model with Javascript.
    Hah! Jesus, definitely go for OpenGL so! You can still use SDL for the windowing/input management if you don't want to dive straight into Win32 nastiness.


  • Registered Users Posts: 2,082 ✭✭✭Tobias Greeshman


    If you're not comfortable with Win32 programming then maybe use SDL as some suggested, or there's also a wrapper library around opengl called glut, I remember using it a few years back and you just needed a main function and it made handling input very easy too. (this is assuming your lecturer hasn't stopped you from using third party libs like SDL, or glut).

    Some suggestions:[list=*]
    [*] Asteroids, not easy and certainly a challenge.
    [*] Tetris - easy enough.
    [*] Pacman - same really.
    [/list]

    I'd suggest you look at some OpenGL code, don't worry about the Win32 code so much for a window, but try to get your head around the GL initialisation code, the different view and projection matrices and their uses. Someone posted up nehe.gamedev.net. This is a great site, and is where I learned programming OpenGL. If you can get your head around the first half a dozen tutorials, then you'll be sorted for this project.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Yeah, we can use that glut library, thanks for the suggestions.


  • Registered Users Posts: 1,481 ✭✭✭satchmo


    Glut it pretty good alright, although it hasn't been updated in a good few years. But you'll need to use external libraries to load images for textures and to setup audio and play music & sound files, whereas SDL does these for you.


  • Closed Accounts Posts: 413 ✭✭sobriquet


    For a college project I wrote an OpenGL game - it was W32/C++. I didn't use GLUT afai recall, I did the window setup etc by hand. I used DevIL for loading textures. Easy to use to the best of my recollection. (I used OpenAL for audio, but that may be beyond the scope of your project.)

    Must dig it out. Had some cool effects - random terrain, with blocky tanks on them and projectile physics.

    OP, don't get carried away with your Asteroids idea. First thing's first: get a window up and render the 'ship'. Add user control, then you can think about the asteroids themselves, and then collision detection and projectiles. Do the simplest thing that can work, then build up incrementally.


Advertisement