Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Showing forms/messages/text over game screens.

Posted on 2003-11-09
7
Medium Priority
?
530 Views
Last Modified: 2010-04-05
How can I show of form or message or text (or do something else like this) over/in a fullscreen DirectX or OpenGL game (for example 'Counter Strike/Half Life', 'Unreal Tournament', Warcraft)? If an application needs to show an information to a user even if he's playing games.

Thanks,

Sergio
0
Comment
Question by:sergiogn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 6

Accepted Solution

by:
DaFox earned 1000 total points
ID: 9711751
Hi Sergio,

I couldn't say it better than it is described in this faq answer: http://www.fraps.com/faq.htm#coders

-
"Unfortunately there is no simple way to draw graphics on screen. [...] Fraps works by patching directly into the underlying graphics API. Doing things this way allows Fraps to issue graphics commands as if it were the game itself, avoiding having to do a large amount of setup beforehand. [...] The first method is referred to as “API hooking”. [...] The other method is to write a “DLL wrapper”."
-

BTW: fraps is an application that shows you your framerate in the upper left corner of any fullscreen OpenGL or DirectX game.

Regards,
Markus
0
 

Author Comment

by:sergiogn
ID: 9711792
So if I have to write a DLL wrapper where should I search for reference/tutorial for my case?
0
 

Assisted Solution

by:delphifreak
delphifreak earned 1000 total points
ID: 9714447
Hi Sergio!

I know that the answers marked in my question are not the right ones, but i had to close the question, and because of this i shared the points ...

It can be done with GDI (i think it's called like this), but with this method the things you draw on the screen have to be updated with every frame. So the text 'blinks'.
But this is not the best method ...

by delphifreak
0
 
LVL 6

Expert Comment

by:DaFox
ID: 9739836
Sergio, do you really think writing a DLL wrapper is a good choice? You have to replace the original DirectX/OpenGL DLL with your own one and pass all "information" you get to the original one (that you renamed before).
That means a lot of work and your wrapper doesn't work with newer versions of DX/OpenGL for shure!
Personally, I'd rather use API hooking. The chance that your code works with a newer version of the dll is better than using the wrapper technique!

Markus
0
 

Expert Comment

by:delphifreak
ID: 12706086
I found another, better solution for the problem:
What you need for drawing text, for example in a DX game, is a handle to the IDirect3DDevice of the game (for the D3DXCreateFont-function or whatever). It is not easy to obtain this, but it is possible, by hooking the API-Functions of the DirectX Libs.
The best way to get the handle is hooking the Present-Function, which is called every time a new frame is drawn. And that's the point where you have to draw your text.

OpenGL is a little bit easier, but the biggest problem there is drawing the text. There is a nearly similar function called when drawing a new frame, often named SwapBuffers.

API Hooking is very easy, if you have the right lib. I am using Madshis MadCodeHook-Lib, which is available at http://www.madshi.net/ . Some helpful examples are provided too.

ciao, df
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

648 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question