473,385 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

The best way to render in Direct3D 9

I've been working on this for a couple days now. I'm really looking for the best way to render. Nothing too complicated but something that is fast, reliable, and powerful. I've seen many websites and about each one shows a different way. I've probably gone through about 5 different ways so far. But I'm really looking for a good, reliable one and I don't think I have found it yet.

I'm looking for a way that if the game is minimized, then no rendering will take place. Such that, the CPU usage is less than 5%. Also, a lot of people say handle the message to check when the game is minimized and then sleep every 50 ms until the game is back up. That just seems so messy to me. I'm looking for a way that will not Render or anything like that when the program is minimized, but when it is maximized, the device will reset.

I'm looking for a way that will process messages very fast (i suppose with peekmessage combined with a while loop) and a way that will allow the program to exit once the message is WM_QUIT. Perhaps the outer loop being a while loop checking peekmessage for WM_QUIT? I'm just not sure. I guess I'm just looking for a perfect loop. I know there probably isn't one, but there has to be at least some good ones.

Most of the examples I find on the web, the CPU usage is 50% when the game is minimized, the device doesn't properly get reset when the program is maximized again, etc etc.

I fiqure I should use TestCooperativeLevel() but whatever I try always never works (processing while game is minimized, device not getting reset properly, etc.)

Really, I'm just looking for idea on creating a GOOD render loop. One suitable for a large game. Thanks for any help :)
Jul 30 '07 #1
0 987

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ark | last post by:
Hi everyone, Does anyone know if Direct3D overloads System.Math functions? Also is it possible to access the base functions of the overloaded function (in other words restore original of the...
1
by: Serdar C. | last post by:
is it possible to write a web based program that uses direct3d?? and if the answer is yes, then do u know where to find an example or tutorial??
1
by: mirage | last post by:
Hi, Actually, I use C# and WinForms to develop my littles applications. Now, I want develop a game like Tetris or Pacman, and I am asking who is the best API for me... Some of you have Game...
2
by: Lee Swanson | last post by:
Hi, I am trying to run a Direct3D tutorial, namely "hello teapot": http://www.gotdotnet.com/team/directx/learn/tutorials/helloteapot.aspx Unfortunately I am getting the following error when I...
2
by: Big D | last post by:
I'm trying to write a game in c# using managed direct3d, and I have a bit of a situation. I'm using sprites to draw my 2d graphics, and I'm generating some of my sprites dynamically by writing to...
1
by: TechGenius | last post by:
I have an application with a form that direct3d draws to. The direct3d rendering loop made the application unresponsive, so I created a new thread to do the rendering and I call Application.Run on...
4
by: Jax50 | last post by:
Hello, i'm trying to find the best way to init in c++, i'v tryed pointing _HAL -_REF&32... what is better? (i'm using the most simple init possible) void initD3D(HWND hWnd) { d3d =...
0
by: Jameson | last post by:
ok... This isn't working, and I dont know why, when I pass the resulting surface to StretchRectangle I get the awsome "error in application" haha... anyway. Is this not the right way (using...
2
by: stephen.diverdi | last post by:
I have a question about what's the best way to handle something in C++ without a lot of redundant code and void*s because I don't seem to be able to avoid them both. I've run into it before and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.