GLUT or wgl which one

This is a discussion on GLUT or wgl which one within the Game Programming forums, part of the General Programming Boards category; well I've never ever done a bitmap game or anything, in fact I've seriously had no luck with bitmap games, ...

  1. #31
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    well I've never ever done a bitmap game or anything, in fact I've seriously had no luck with bitmap games, the bitmaps always seemed to cut out and crap, but this is a simple example that should give you the right idea. I'm not sure from what source I learned to used bitmaps, I think a cross between nehe and gl game programming, but anyway this is a pretty straight forward program except for the variable SHORT asdf, for some reason the last variable that checked movement made the bitmap blink out, I've had that happen before (does anyone know why?) so I just had the last variable be a dummy variable

    EDIT: w, a, s, and d move the bitmap around the screen, i accidently included vector files from another project, pay no attention to those (too lazy to re upload)
    Attached Files Attached Files

  2. #32
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218
    I dont know why but after this iprogram i got the urge to brush my teeth more.often!.


    thx for the code.

  3. #33
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    My cd has all the code, maybe you got a bad print/copy?

  4. #34
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218
    RoD while u r here i have a question:

    I do everything in C and know of general terms about C++ but except basic stuff i cant do a major C++ program .now in tutorials i see for instance;

    CCAMERA:ositioncamera(float x);

    and i know its a member function of class camera its not that hard.

    but if it gets more complicated than this i be having problem

    1-do i need to learn more on C++ or my knowledg of it is enough to get me through opengl framework environment?


    2-is CCAMERA a opengl standard function?if not how do i differentiate between opengl stand functions and application tutorial function when it comes to tricky codes like CCAMERA?

  5. #35
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    1) I'm going through it. If i can, you can lol.

    2) i honestly don't know, i'm not into the cameras yet. Silver or Travis would know.

  6. #36
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    It's hard to say if you absolutely must learn all of the important aspects of C++ in order to be able to understand game tutorials. I find that most tutorials don't bother to use the advance aspects of C++, such as templated classes/functions or polymorphism. Ultimately, however, C++ is probably the better language for game programming (using objects just works really good).

    For example in a project I'm working on I've got an stl vector of GameEntities. GameEntity is a base class with SendMessage, PutMessage, and GetMessage functions all used for communicating with a GameController_t object. GameEntity also has virtual Load and CallDraw methods. GameEntity is used like this in my game:

    std::vector<GameEntity> Entities; // all of the 'characters' in my game
    //Player, Enemy, and Planet are some classes which derive from GameEntity

    Entities.push_back(Player());
    for(i = 0; i < NumEnemies; i++) {
    Entities.push_back(Enemy());
    }
    for(i = 0; i < NumPlanets; i++) {
    Entities.push_back(Planet());
    }

    That example shows a way you can use polymorphism in C++ for games, and if you understand what I'm getting at it 'just makes sense'. It makes sense because each Player, Enemy and Planet in the game is a gameentity, and each gameentity needs to be able to send, put, and getmessages from the gamecontroller, but each gameentity also needs to be able to define its own load and drawing methods. If you don't understand a lot of what I'm talking about don't worry too much, but I think it'll pay great dividends to learn C++ and get into object oriented programming.

  7. #37
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by SAMSAM
    2-is CCAMERA a opengl standard function?if not how do i differentiate between opengl stand functions and application tutorial function when it comes to tricky codes like CCAMERA?
    There's a camera function build into OpenGL, But you can write
    one yourself, It's very easy.

    [edit]

    CCamera is not an OpenGL class, At least not a standard one.
    Last edited by Travis Dane; 02-15-2003 at 08:34 PM.

  8. #38
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    If it's a class, it's not OpenGL. If you can see the implementation of it, it's not OpenGL.

  9. #39
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218
    thx for a while after seeing that ,i thought i have to deal with classes then friends and buddies of classes then their granchildren "inheritance" and toddlers"protected" and unidentified guests"virtual functions" and what have u .great!

    so i can still do it through my own C functions after i get little bit more comfy with opengl.

    do all of u do programming full time?

    and do u make a living at it ?
    how did u get interested in it?

    i dont know about u ppl like travis and rod and silvercord you are all probably lucky enough to be in university right now and your main task is programming so keep doing it .me i am in my thirties
    long time ago left university "mech eng" unfinished and started my own buss that i should say makes me pretty good money but i missed the academic life and it was late u know "child mortgage,,,,,," 5 years ago while playing quake and chatting with quake players online started getting intersted in programming ,that got me on the road to realy do it as hobby

    BASIC->html->C dos->win32 API----its great u know why? because i do it for the fun of it , and not for money(eventhough i iwouldnt mind the money).

    i said all that to tell u folks that i envy you because your main preocupation is something u like "programming" so u can devote ur time to it. so stick to it
    and u wont regret it when u be my age assuming u are all in your 20s.

    good wishes!

    one question though ;

    1-if i code a small game engine in GDI and rather than displaying
    repetative bitmaps and rotatations and tranformation of them,
    use system colors and manupulate a static"multishade" scenery
    and base the mvements not on changing the frame but changing its attributes and make everything realy lean and trim to the max.then can this game be as fast as the opengl or dx
    version of it "i know that the code cant have direct access to vid mem but in this case does it realy matter"?
    and if its slower by ur experience on comparing a GDI game and 3d game of the same

    type what average FPS difference is between the two?

    dont mind me with my many questions u dont have to answer them all;

    cheers!

  10. #40
    Shadow12345
    Guest
    I'm going to take a crack at this because no one else has. I would say no, your GDI game won't ever be as fast a OpenGL or directx, although I'm not exactly sure how GDI works. It says that GDI doens't access hardware directly, rather it 'interacts with device drivers on behalf of the application'. I don't know what the difference is between accessing hardware directly and interacting with the drivers, but every GDI game I've seen gets bogged down with not-that-much going on in the game (compared to OpenGL). Also, isn't GDI limited to just 2d graphics with bitmaps and stuff?

  11. #41
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Wasn't GDI incredibly slow?

  12. #42
    Shadow12345
    Guest
    that's what i've always thought. The most recent game with GDI I've seen was Hunter's space shooters, and that would run OK for a while, but when there were multiple space ships it would really bog things down.

  13. #43
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218
    Also, isn't GDI limited to just 2d graphics with bitmaps and stuff?


    yes and no;

    offcourse you are not going to get incredible scenes like MYST but

    you can manipulate a bitmap per frame with the right shading to make it a legitimate 3d scene(i have done a few samples a while back on my other comp before it crashed and i lost 3.5 years worth of sample work i had done)but the good thing about GDI based graphic is that its much more portable compare to directx

    ...(using COM and its different interfaces has actually defeated the original purpose of MS to make directx device independent
    by using different versions interface to different COMs)

    last note*

    you can even make a crude 3D scene with 8bit(256 colors) and use of pallett manager in GDI . so it can be done.

    it can be done as good as dx version if john carmack was doing it.

    haha!

    by the way in an interview he said he is involved with a rocket project that will fundamentaly change the core technology that NASA is using to send man to space.so no
    more new versions of quake ,for a while.

    he is only 29 years old

  14. #44
    Shadow12345
    Guest
    He was 29 in 2000, and I don't see how armadillo aerospace could change the way nasa does anything. Heck their 'spaceship' looks like nothing more than a platform with engines, which is pretty cool, but that means they won't even be able to go into orbit because if they got going too fast the pilot would burn up upon re-entry.

    EDIT: I guess they really are planning on sending a person into space with these things they're building, but I still don't see how it's feasible
    Last edited by Shadow12345; 02-20-2003 at 04:06 PM.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to get relative mouse coordinates when GLUT return absolute
    By joeprogrammer in forum Game Programming
    Replies: 14
    Last Post: 02-10-2009, 06:35 PM
  2. Running into trouble with GLUT.
    By Josh@Dreamland in forum C++ Programming
    Replies: 4
    Last Post: 12-29-2007, 09:32 PM
  3. Glut
    By Matty_Alan in forum C Programming
    Replies: 7
    Last Post: 07-16-2007, 08:01 AM
  4. GLUT and Dev-CPP
    By Canadian_coder in forum Game Programming
    Replies: 4
    Last Post: 12-22-2004, 03:12 AM
  5. Dis/Advantages of Glut?
    By Zeusbwr in forum Game Programming
    Replies: 1
    Last Post: 11-28-2004, 10:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21