|
-
Jun 3rd, 2018, 09:04 AM
#11
Re: Direct2D Typelib+ for VB6
Hi Baka,
I haven't started messing with Direct2D. But, as I'm sure you know, I managed to get a fairly substantial Direct3D project going, using The Trick's typelib.
One of the early problems I ran into was my FPS being faster than my monitor's refresh rate. By default, Direct3D refreshes the screen at the monitor's refresh rate as the fastest it'll go.
However, with some digging, I found the PresentationInterval item of the D3DPRESENT_PARAMETERS structure (UDT), which is used to initialize a IDirect3DDevice9 device. By default, it's PresentationInterval is set to D3DPRESENT_INTERVAL_DEFAULT, which won't go faster than the monitor's refresh rate. However, if you explicitly set PresentationInterval to D3DPRESENT_INTERVAL_IMMEDIATE, the Direct3D refresh rate becomes completely detached from the monitor's refresh rate, allowing you to render frames as fast as your CPU/GPU will do it for you. You must do this as you're instantiating your IDirect3DDevice9 device.
That solved a huge problem for me, and allowed me to make perfect sense of my FPS.
I don't know for certain, but I have to believe there's a similar setting in the Direct2D system.
Good Luck,
Elroy
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|