Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Speed Anyone???

  1. #1
    Member Newbie
    Join Date
    May 2001
    Location
    Montreal, Canada
    Posts
    31

    Speed Anyone???

    hi

    well i made a cgl class to encapsulate all the opengl code... at first i made everything public (HDC, HGLRC, etc.) and to access them as wnd.m_hDC etc. so when i ran it with a maximzed window it ran fine. Then i made all the variables private and used get and set functions to access them... now when i run my program in a maxized window its REALLY SLOW (all it does is displays a rotating triangle) but it runs fine on a 300 by 300 window.

    could this "slowness" be caused because of the function overhead... i mean.. i only access the GetDC and GetHWnd functions... is it possible dat those 2 functions make such a big difference...

    thx

  2. #2
    Member Contributor
    Join Date
    Aug 2000
    Posts
    68

    Re: Speed Anyone???

    No!

    Surly they are only called at the start, hence they would have no effect on FPS later.

    First are you sure it works grand a 300x300. If your fullscreen window is 1280x1024 then its going to be alot slower than a 300x300 window.

    Otherwise you're going wrong somewhere else, post up some more info.

  3. #3
    Member Newbie
    Join Date
    May 2001
    Location
    Montreal, Canada
    Posts
    31

    Re: Speed Anyone???

    Yes my fullscreen window is 1280x1024. But how can it be so slow ( Tnt2 32megs ). My test program remains unchanged. Only change is use the get functions to have access to the private members. so i suppose i am going wrong somewhere because the code from nehe.gamedev.net works just fine. And my code is very similar to his. All the opengl code is the same. should i post the whole thing... or should i forget bout the class thing

  4. #4
    Member Contributor
    Join Date
    Aug 2000
    Posts
    68

    Re: Speed Anyone???

    Well, I would recommend forgetting about Class stuff. Theres no need for OOP for such a simple aspect of a program that only excutes once.

    Just don't forget that 1280x1024 is 14 times bigger than 300x300, therefore it will be slower.

    Write a simple FPS counter and post the results. They may be quite respectable

  5. #5
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Speed Anyone???

    is your scene a simple one ie less than 10000 polygons if so. ild expect fill to be playing a big role thus the 1280x1024 will be 14.5x slower than the 300x300

  6. #6
    Member Newbie
    Join Date
    May 2001
    Location
    Montreal, Canada
    Posts
    31

    Re: Speed Anyone???

    i think i will forget about the class thing because all i am displaying is one rotating triagle and its slow. and when i run nehe's code at 1280x1024 with a rotating triangle... its at the same speed as 300 by 300 so i am going wrong somewhere... which i can't find because my opengl code is the same as nehe's ne way thx

  7. #7
    Junior Member Newbie
    Join Date
    Jun 2001
    Location
    North America, .
    Posts
    26

    Re: Speed Anyone???

    Probably your context use the software implementation.
    Did you know that trekbbs use the same bbs engine???

  8. #8
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Speed Anyone???

    >>nd when i run nehe's code at 1280x1024 with a rotating triangle... its at the same speed as 300 by 300 so i am going wrong somewhere<<

    no card yet invented will display a rotating triangle the same speed at 300x300 as at 1280x1024.
    i guess whats happening is the display is getting synced to the monitors refresh rate eg 75,85hz. u should be able to disable this in the display properties. look 4 'disable vsync'

  9. #9
    Member Newbie
    Join Date
    May 2001
    Location
    Montreal, Canada
    Posts
    31

    Re: Speed Anyone???

    Originally posted by Qwylli:
    Probably your context use the software implementation.
    is there a way to set the context to use hardware implementation?

    i disabled vsync and it still does the same thing.

  10. #10
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Speed Anyone???

    There is no way to explicitly tell Windows to use hardware acceleration, you just get it if the hardware CAN accelerate what you ask for.

    If you want hardware acceleration, you must make sure you only ask for stuff the hardware can handle. For example, if you ask for an accumulation buffer, almost all consumer level hardware will fall back to software since tey can't handle an accumulation buffer. On NVIDIA hardware (GeForce/TNT) for example, you must not combine a 32-bit depthbuffer with a 16-bit framebuffer, and ask for a stencil buffer only if you are using a 32-bit framebuffer.

    To check if you are using a software renderer, call glGetString(GL_RENDERER) and see what it returns. If it returns something with "Microsoft", you are running in software.

Page 1 of 2 12 LastLast

Similar Threads

  1. Need to speed this up
    By atlasdynamics in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 07-06-2011, 02:10 PM
  2. speed
    By davidib in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 02-06-2005, 12:44 AM
  3. Need for speed!
    By zetwal in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 09-19-2002, 11:55 AM
  4. speed on pc
    By dhoffman in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 04-20-2001, 01:37 PM
  5. speed
    By imported_sebastian in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 08-20-2000, 09:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean