Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Opengl & event on mac.

  1. #1
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Opengl & event on mac.

    Thanks in advanced to all, i'am a mac developer. Now i have insert in my app framework ( from a while i put it in open source in sourceforge.net) but i have a little problem. There is anyone, that can explain me the right way to manage event in a mac enviroment for get maximun performance, on nullevent, to manage all the opengl 3d engine?
    My goal is to make a good, easy, framework in opengl to do game.
    If anyone can help me is good thing.

    Thanks to all.

  2. #2
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Opengl & event on mac.

    Hi,

    I think you can use GetNextEvent or GetNextOSEvent to speed up your application event processing. Just call this functions in a loop until there are no more messages and all the tiem left in your loop can be devoted to rendering, processing input and so on...

    I hope that kind of answer you question .

    Dan.
    Being crazy is not a requirement but it helps.

  3. #3
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Opengl & event on mac.

    Thanks BANE,
    Now i have set the time waith in WaitNexEvent to 1 so, nullevent messege came regularly.
    Sorry for english.
    I'm novice in 3d bu i have a discrete experience how mac programmer.
    I hope to became a good 3d programmer for 3d app.
    Do you know i can make a texture trasparecly, from a file jpeg in memory?
    Thanks in advanced BANE.

  4. #4
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Opengl & event on mac.

    I cannot tell you how to load it from a jpeg file but once you have loaded it in memory, you need to convert it to a RGBA format and you set the alpha value to what you want across the texture and store as RGBA as well. When using it, you need to enable blending and then define a blending function like glFunc( src_alpha, one_minus_src_alpha ).
    That should work .

    Good luck,
    Dan.
    Being crazy is not a requirement but it helps.

  5. #5
    Guest

    Re: Opengl & event on mac.

    Hello

    I think GetNextEvent is faster than WaitNextEvent. And by setting the eventMask to only these events you'll need its maybe even faster abit (not so sure about that and do this only in fullscreen apps)

    For blending: there are great tutorials about specific techniques like blending, lightning, texturing and much more on http://nehe.gamedev.net/

    they use the tk library to load textures and glut to display, but they work on the OpenGL_DrawSprocket-example too

    Greetings
    Noel

  6. #6
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Opengl & event on mac.

    Thanks BANE and NOEL.
    Yesterday i have prepared my app framework to be a game framework.
    It can be initialized for be used to make app and game (windowed and multiwindowed mode or fullscreen).
    I thinks that what i'll do is to use open gl only for drawing poligon and texture.
    Other computatiol purpose, new postition of object in scene evre new frame, ar coòputed by cpu (only vertex position) then printed on Opengl buffer.
    NOEL and BANE, what do you think about that?

    For NOEL: I have tryed getnextevent and it work better. thanks.

    NOTE: I'll put my framework project on sourceforge site. if any one can help me to do this....

  7. #7
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Opengl & event on mac.

    Hi,

    Correct me if I am wrong as I am not sure I understood what you meant but I think you only want to use OpenGL to display polygons after you calculated the vertex outside OpenGL.

    Well that's one way to go about it. But my view on this is let OpenGL handle the transform. You have less chance of mistake that way but of course you have less control about what is happenning.

    What I do at the moment is to clip the polygon in world coordinates and then send what polygons are left to OpenGL.

    Dan.
    Being crazy is not a requirement but it helps.

  8. #8
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Opengl & event on mac.

    Yes Dan,
    It is an carmack idea. Calculating the position by 3d engine ,this is not simple but very powerfool,the game can use a big power of new cpu. If we can do all to video hardware what must do the cpu?
    On Macitosh, all game that use opengl go bad, using 3dfx 2000.
    Quake 3, work with opengl but go faster than unreal....
    Carmack use only one point, in cycle event, where call Opengl api. This point is the redraw of enteire scene.
    Try unreal in opengl and quake3.
    A question:
    You use macintosh for develop your app?

    Claudio

    [This message has been edited by Claudio (edited 06-22-2000).]

  9. #9
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Opengl & event on mac.

    I think you have it wrong. John Carmack on a Mac dev list said it is genarally OK to let OpenGL handle the geometry and the 3D world. You only use the CPU to calculate the new frustrum at every step and clip the world with it. Plus with the advent of hardware transform and Lighting, it is going to be a load off the CPU soon. And anyway, at the moment on the Mac, using OpenGL to do the transform probably use the CPU. So it is better to use an old but verified system or to roll up your own function which might not be as optimised ??? It's your call.

    I develop with OpenGL on the Mac and frankly before I updated my Mac, the Voodoo2 card I had looked much better the ATI 128 card I have to use now.
    And on the plus side, I can learn Glide too on the Voodoo2. Not used very much though.

    My take on this is test the OpenGL path and your path and select whichever is faster for you.

    Dan.
    Being crazy is not a requirement but it helps.

  10. #10
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Opengl & event on mac.

    Ok dan , you have right.
    What mean, when you said that use cpu only for calculate frustum operation?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •