News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

OpenGL - fullscreen or windowed? Any difference?

Started by hamper, November 19, 2013, 08:56:55 AM

Previous topic - Next topic

hamper

As you are all probably (and painfully) aware by now, I'm trying to learn how to program graphics using OpenGL, and sticking strictly to using assembly language. Thanks to a LOT of help from a LOT of people on this forum (and I thank you all again), I've managed to get a working program up and running that displays a simple, rotating, multi-coloured triangle (as attached, but you won't like my programming style :eusa_naughty:)

To get to the point, I'm wondering if there is any difference in speed between running in windowed mode and running in fullscreen mode. I've read that OpenGL automatically uses hardware acceleration when it's available (which it is, on my pc), so can I assume that when I run my little example it's already running with hardware acceleration even in windowed mode? Or do I need to do something extra to get it running in fullscreen/hardware-accelerated mode?

Does anyone know of any good examples/tutorials that describe how to get an OpenGL program running in fullscreen mode with hardware acceleration (assuming that this is completely different to running in windowed mode)?

Finally, Hutch - would it be useful to have a Forum section dedicated to OpenGL, and graphics programming in general, so as not to clutter up the Campus too much?

Thanks in anticipation.

Phil

dedndave

you have undoubtedly looked in the control panel, Display settings, hardware accel...
i think from win7 and up, full-screen "mode" isn't available
so, maybe not a good idea to plan on using that
but - you can still make a borderless window and take up the whole screen - lol

i doubt the program runs any faster, but you could try measuring the speed
count the updates - measure the time - and divide
when you close the program, display a message box that shows the rate
if you want to get more accurate measurements, use Michael's timing macros to measure clock cycles
many of us use the macros for benchmarking algorithms

http://masm32.com/board/index.php?topic=49.0

by the way - your program runs ok on XP MC2005, SP3

hamper

Hi Dave, nice to hear from you again,

My 128 Mb NVIDIA card has a vertical (default, I believe) refresh frequency of 60 Hz, and the little spinning triangle seems to rotate at about that rate. The program swaps the buffers every 1 degree of rotation, and it seems to spin at about that rate (60 Hz). But that's just a little, simple triangle. I'm wondering, once I get onto programming DOOM XXVII whether the same will apply, i.e. if the whole drawing gets a LOT more complicated (lights, fog, textures etc.), will it all still get rendered and swap buffers at 60 Hz. I'm afraid I don't know enough about graphics cards and how they work (or OpenGL for that matter) to answer that (yet) but I'm trying to get to grips with it all.

So I'm at the starting point, trying to lay solid foundations for the future. Do I need to start off getting fullscreen/hardware acceleration up and running, or is this something I don't even need to take into consideration, now, or ever? Again, I'm just a novice on graphics, and I don't know enough about how graphics cards or OpenGL does things behind the scenes. But if there's something that needs to be done, now's the time, eh?

Phil

Siekmanski

Hi hamper,

Are you aware of the NeHe tutorials?
A lot of OpenGL info.
Have a look at the "Legacy Tutorials".

http://nehe.gamedev.net/
Creative coders use backward thinking techniques as a strategy.

dedndave

right
i am more or less in the same boat - also a novice with OpenGL

as for acceleration....
each machine has a set of drivers associated with the video adapter/CPU/OS
if acceleration is available, the drivers will support it
i don't think you have to be too concerned with it
it will either be there, or it won't - and OpenGL uses the fastest thing supported

i am primarily interested in 3D height maps, at the moment
so, the triangle was of interest to me because it may be the basic structure in my future code

http://masm32.com/board/index.php?topic=1890.msg20167#msg20167

so my app is a little different, and i don't intend to update as often as 60 Hz
in reality, the human eye only updates something like 10 times a second
but - many video formats use ~24 to 30 frames per second to get good results
even though you are drawing many more - and more complex triangles, they are also much smaller   :biggrin:

either way, i suspect OpenGL is the fastest you are going to get over a variety of hardware platforms

the issue i am currently looking into is OpenGL versions
it seems that providing 2 routines for everything may not be a bad approach, if you want highest performance
i am using XP - many do - and i want my software to support XP
so - that leaves me at, say, OpenGL ver 1.2-1.4
but, newer machines support 3.3 and higher, which may execute older code slowly
if you want best performance on those machines, you may have to use different code

farrier

There are at least a couple of active threads on flatassembler.net that would be worthwhile consulting:

http://board.flatassembler.net/topic.php?t=15917

http://board.flatassembler.net/topic.php?t=15746

search for other opengl and glfw threads at board.flatassembler.net

hth,

farrier
For the code is dark, and full of errors!
It's a good day to code!
Don't Bogart that code, my friend!

dedndave

thanks farrier   :t
a bit over my head, for now - lol

Magnum

Nice program.

I looked at your code but did not see what to change to effect a slower rotation speed ?

Thanks,
               Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

GoneFishing

#8
Hi hamper,
nice to see you with another hot topic

Maybe glHint function is what you need at a moment:
QuoteDescription

Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. target is a symbolic constant indicating the behavior to be controlled, and mode is another symbolic constant indicating the desired behavior. The initial value for each target is GL_DONT_CARE. mode can be one of the following:

GL_FASTEST

The most efficient option should be chosen.

GL_NICEST

The most correct, or highest quality, option should be chosen.

GL_DONT_CARE

No preference.
...

Another helpful function to explore your device caps / settings is glGet

There was the separate OpenGL board in the older forum

P.S.: BTW nehe.gamedev.net is not available from here :(
P.P.S.: but I've found this post !!!

Siekmanski

Here are the Masm OpenGl examples by hitchhikr

http://perso.orange.fr/franck.charlet/Ogl_Asm.zip
Creative coders use backward thinking techniques as a strategy.

dedndave


GoneFishing

Quote from: Siekmanski on November 19, 2013, 10:16:44 PM
Here are the Masm OpenGl examples by hitchhikr

http://perso.orange.fr/franck.charlet/Ogl_Asm.zip
My Smart Screen blocked this download reporting that it had a virus inside.
Did anybody else try to download it and scan  with AV  ?
Does anybody has  "healthy" version of the archive ?

dedndave

it's probably your AV - i doubt Franck would do anything malicious
the archive is ~4 mb
if your AV won't allow you to d/l it from Franck's site, i don't know how else i'd get it to you
see if you can temporarily disable it


GoneFishing

Well, I solved the problem 
That archive is already here in special AV folder:
D:\ProgramData\Microsoft\Windows Defender\LocalCopy\{AE7B293D-397A-4DF8-8152-BAA2182838B1}-Ogl_Asm.zip

EDIT: Thank you, Dave !

report: