Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Rendering Questions

Author
Message
xix psycho xix
9
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 24th Jul 2015 04:30
So I'm back to make yet another attempt on creating a GUI library for DarkGDK .NET. I know at this point this is mostly to my benefit, but I want to do this and I'm pretty far along! I have a working event system and proper mouse / keyboard I/O. The problem I am having is in rendering, and there are actually two problem areas for me.

The first is this. Right now I am rendering similar to the following:

+ Code Snippet

This code, no matter how hard I try, will not correctly render the bitmap to the screen. Here is why I designed it this way. A window may be contained in another window, and this code attempts to solve the problem of the window overrunning it's parent window. I switched to a bitmap approach for this reason. Originally I was drawing to the bitmap, converting it to an image, then pasting to the screen. Obviously my frame rates dropped like a lead brick. The next solution was to direct-draw everything, but the problem was the controls would overrun the bounds of the parent. Even if I solved the problem of the drawing staying in-bounds of the parent's client area (enforce bounds-checking on each child against the parent, breaks encapsulation) I couldn't hope to use a routine like ShowText() to place text in a control, as there is no way to avoid an overrun without tons of extra processing (framerate issue.) So I switched to this approach, hoping to simply nest the bitmaps instead to improve frame rate.

So the question is, how can I fix the code I have for it to work (since right now I just get blank output), or how can I better draw my UI objects to avoid this problem entirely? Even with each widget using pure drawing commands to update itself, the frame rate drops significantly for each additional UI component. I am testing on a low-quality machine, but I feel like a UI should be lightweight enough to not hamper game performance. Any ideas?
Morcilla
15
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 20th Oct 2015 11:32
This might be a silly question, but what happened with the sprites?
It seems that you are replacing the whole background bitmap, shouldn't you use little sprites instead of that full approach?
Just from my ignorance...

Login to post a reply

Server time is: 2017-12-16 14:55:40
Your offset time is: 2017-12-16 14:55:40