Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

DX8 "Controls"


abhi2011
 Share

Recommended Posts

Hey guys,

I was just thinking on how we could improve structurally the engine. I got into the idea of using classes rather than type structures and using VB6 Controls for a GUI. 

What it is is basically a VB6 Control that has properties such as width, height, x, y, Name, Path to texture etc. These would all be put in to the game just like adding in Picture boxes and Command Buttons.

The game would work as normal but rather than the GUI rendering being basically hard-coded it would render onto this control. Something like this: 

> Control: ctrlGUI1
>
>  
>
> Properties: 
>
> Name: The name of the control
>
> Path: The location of the texture. It should be relative to the project. 
>
> X coord: Understandable
>
> Y Coord: Understandable
>
> Height: Understandable 
>
> Width: Understandable

The rendering would be something like this: 

> RenderGUI {Control Object}

And RenderGUI would call RenderTexture which would render the texture.

As far as rendering the texture goes I'm not sure how it would be done. 

Not sure if I have a private pic property onto which the texture would be "rendered". Not sure if this would work and whether it would support Alpha channels. 

Another method would be render the texture in the normal way with the only changes being the x, y, width, height and path is taken from the control making the control a store of meta-data for the gui. 

Another "add-on" would be events like key events or mouse events such as mouse clicks and stuff. VB6 already provides an API so what not just use it? My thought would be to rather have the event fire change a global variable or such fire and the game on it's update loop updates the game. Not sure how async this'll go but it should be pretty mcuh async. 

On of the advantages to this would be an easy GUI editor. (But this could be possible with a standalone VB6 or .NET app which dumps an XML or binary file which the client reads.) 

And I think the only problem would be implementation which would be the biggest problem and lag. 

I would like to know your opinion. Would this be something cool for the Engine? Or do you think it's not worth the effort? 

Yes I know the language is pretty much dead but hey it would be fun to try it out.
Link to comment
Share on other sites

Go ahead. I was going to do this (create a UI system with DirectX 8 using classes) but never got started. Well, I did get started but never got far enough. Instead of using Visual Basic 6 controls, I was using DirectX 8 to render custom ones.
Link to comment
Share on other sites

> Instead of using Visual Basic 6 controls, I was using DirectX 8 to render custom ones.

Could you expand on this? I don't understand how you used DirectX8 to render custom ones. The nearest I can get is that each "control" would render by itself using DirectX8?
Link to comment
Share on other sites

> Abhi2011, look at some different DX8 rendering in some of the custom engines… they render buttons and windows and stuff...instead of using literal controls.

Where does Abhi say he wants to use GDI controls?

Reading comprehension. I think Abhi is more than capable of using D3D8.
Link to comment
Share on other sites

> Abhi2011, look at some different DX8 rendering in some of the custom engines… they render buttons and windows and stuff...instead of using literal controls.

As a sum up of Carim I never intended to use Controls. That would be seriously stupid. 

The controls would be basic placeholders.
Link to comment
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
 Share

×
×
  • Create New...