Next Generation Emulation banner

1 - 6 of 6 Posts

Crazy GFX coder
17,133 Posts
Discussion Starter #1 (Edited)
I decided to create 1 thread per Day because is getting huge lol

@ES - MorphX: Day 3 "Design and Performance"

Lovely diary... i hate you because i don't have enough time to code today :p

DirectX requires a HWND to render the stuff. if a Window is layered(like the ones here) you don't get any warnings but instead GDI+ is activated by default which is the reason why its going to get slower if you don't add stuff wisely.

now what to do???? quite simple yet not easy to do as you will have to deal with things that can be tricky. the main idea is to grab several windows and stick them toguether to make layers. in that way you can keep a great design and performance will no suffer any loss as you will see at a later time :thumb:

What is a HWND?
Short answer: A handle is an opaque type. Essentially, it is just a number that the operating system uses to identify an object.

now... how do i do that???? the basic idea is to keep this in mind:

imagine you have all those forms and each of them is part of a puzzle. if you put them toguether they create a picture but still they aren't part of other pieces of the puzzle so you can update each one when needed.

lets start!!!

1. before i split the GUI in pieces lets transform our skin into a 3D object and in that way be able to control the ambient light in order to change the color of it any time and avoid the need to re-calculate the entire thing to change the color.

2. Lets split part of the screen so that serves as overlay that we can put over our menus.

3. "The renderer" this one is going to be our "Renderer" layer. other than the rest this one has a HWND as isn't layered and so everything i draw here will take full advantage of DirectX(it still depends on what i do tho.)

4. "The render Panel" this is a panel we're going to use to positionate the layers in and at the same time its going to be our screen.

5. Adding the magic "Win32" class i wrote long time ago that is going to handle the layering and its going to stick them perfectly toguether according to the render_panel position, width and height... lets write the code to show them at start.

6. Voila!!! our GUI is perfectly splitted and sticked toguether no matter what we do YAY!!! what you see right now are 3 layers toguether creating the GUI but they are rendered separately

7. As we can see here Windows detects all 3 layers as one and so i can confirm that my Win32 class is luring out Windows when moving or detecting the window.

8. After all those changes let's see if i was right and confirm 0 performance loss while playing games by hardcore testing the app :evil:.

PC game modder
6,949 Posts
Looking awesome mate:thumb:
1 - 6 of 6 Posts