Drawing on hidden context?

BlitzMax Forums/BlitzMax Programming/Drawing on hidden context?

orgos(Posted 2010) [#1]
Hi folks.

Recently we are testing our framework on different computers (Pcs, and laptops) we notice that on windows xp the game some times run more faster using d3d7 driver, in others computer is better to use d3d9. On windows 7 machines the d3d9 run more faster than others. I buy a laptop some time ago so when I test our game I notice that the game run very slowly using d3d7 and d3d9 drivers so I must use the max2d driver becaus my laptop have a nvidia chipset. So we decide to make a function to test the better driver on window before the game run.

The function draw several rectangles with deferents params, like rotation, alpha, scales etc, and test for 3 seconds what the better FPS for each driver, it run using the screen created by Graphics command.

The problem is that we need to make this process without show a screen.

Any idea?

Really thanks.


slenkar(Posted 2010) [#2]
you could draw teh stuff and then not use flip so nothing is seen

Last edited 2010


orgos(Posted 2010) [#3]
I deal with the show or no show, the problem is that I want to make it without show a screen.


VomitOnLino(Posted 2010) [#4]
Hey orgos, I don't think you fully understood what slenkar meant, I think he is quite right on the spot with his solution.

Basically you do it like this:
Cls

DrawText "Measuring performance",200,200

Flip

For local i=1 to 1000

'Draw your stuff here
DrawRect etc...

'Measure Performance

'Do NOT call "flip"
Next

Cls 'Clear the screen one last time to remove any "test" graphics

'... Do your game stuff


That's all - it's that simple!


orgos(Posted 2010) [#5]
Hi VomitOnLino

To make commands like DrawText you need to create a graphics context or I wrong? I mean call a Graphics command before Drawtext command.

What I want is a way to create a graphic context but not show the screen to the user, at last in the first run.


Jesse(Posted 2010) [#6]
the only way to do that is to draw to a pixmap.


slenkar(Posted 2010) [#7]
drawin to a pixmap wont be the same speed,

you could just show a text message to the user,
"Testing graphics modes"


orgos(Posted 2010) [#8]
slenkar

That is what I'm doing, but its more professional do it in the other way.


zambani(Posted 2010) [#9]
I think you'll still need the flip command to get the proper speed. I did some timing a while back and found that the the process time of flip varied based on driver.

The way I would do it is to draw your test graphic images with the alpha set to 0. That way everything would be invisible and the users will see a blank screen.

Last edited 2010

Last edited 2010


Czar Flavius(Posted 2010) [#10]
In my game I've given a choice of DX7, DX9 and OpenGL as an option in the game and let players choose, with a brief readme about what it means. The default is DX7.


col(Posted 2010) [#11]
My 2 pennies worth.....

Years ago I saw some files in the Unreal Tournament games, they would have a spreadsheet of data of common gfx cards and resolutions and their associated performance. I assumed they would use the data in the selection process according to the platform it was running on ? Maybe it was nothing ?

Last edited 2010