Jump to content
Sign in to follow this  
Lashrathius

Resource elements in C++ gauge

Recommended Posts

I've taken the plunge to learn C++ gauge development. Note that I'm not new to C++; I'm just new Visual Studio and the way gauges are built.

 

Here's what's troubling me. I've downloaded the ESP GDI+ sample starter gauge, but I simply cannot find where the bitmaps are being called.

 

In the root project folder, there is a folder called "res". Inside the res folder, I see:

  • gauge_background.bmp
  • HeadingArrow.bmp
  • HeadingBackground.bmp

 

However, in the code, I only see:

	Gdiplus::Bitmap* mBackgroundBitmap;	// Image used for the background of our 'heading' component
	Gdiplus::Image*	mArrowBitmap;		// Image used as the indicator for our 'heading' component

But digging around the code, there is nowhere that points mArrowBitmap to the HeadingArrow.bmp bitmap. How will Visual Studio know it should use HeadingArrow.bmp when there aren't anywhere in the code that states mArrowBitmap = HeadingArrow.bmp?

 

Is this all done in the file called GDIPlus_GaugeRes.rc? Because the .rc is the only file my Visual Studio express will not allow me to open.

 

Thanks in advance,


3HSAJHT.png

TFDi Design

Share this post


Link to post
Share on other sites

Go study the SDK on how a gauge is defined using the gauge macros. You're missing a ton of information. Also look at the header files, where there's even more defined.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Thanks Ed. I went through the ESP guide and turns out yup, the resource bitmaps are defined in the .rc file.

 

Well, now I gotta find a way to open .rc files; Visual Studio tells me I need to pay in order to edit them


3HSAJHT.png

TFDi Design

Share this post


Link to post
Share on other sites

An .rc file is a text file. If you need proof... load one into notepad. :)

 

Also, be careful... ESP is not FSX.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Thanks Ed. I went through the ESP guide and turns out yup, the resource bitmaps are defined in the .rc file.

 

Well, now I gotta find a way to open .rc files; Visual Studio tells me I need to pay in order to edit them

Right-click on the .rc in the Solution Explorer window and Open in Text mode.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Ah got it working and I see the linking of the bitmaps in the .rc file. Thanks Bill, thanks again Ed.

 

And yup I know ESP != FSX. I am using the P3D SDK, but since it's originally ESP I thought I'd look at those examples from Microsoft's website with the C++ gauge tutorial. 


3HSAJHT.png

TFDi Design

Share this post


Link to post
Share on other sites

What's the reason for using Visual Studio Express instead of Community Edition? The Community edition seems much more capable.


Barry Friedman

Share this post


Link to post
Share on other sites

I haven't experimented with Community Edition; I've used VS2013 with C# for a bit last year, so that was my go-to Visual Studio when I decided to try gauge development.

 

I'll download CE and give it a shot. Hopefully my GDI+ gauge originally built for VS2010 still runs... Creating a backup now B)


3HSAJHT.png

TFDi Design

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...