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 / dbSync commands question

Author
Message
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 15th Jun 2013 00:21
If you are using 2D commands like line, box, circle and color commands do you hve to use the sync commands? And also there is a plugin for DBP called advanced 2D as I am sure most if not all of you know. Is there a version of this plugin for DarkGDK.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 15th Jun 2013 09:53 Edited at: 15th Jun 2013 10:02
Hi, Dragon Slayer

I noticed your post on the DBPro board. The only thing dbSyncOn() does is cause the backbuffer to be drawn to the frontbuffer only when it reaches a call to the dbSync() function. I see so many people being told to use multiple synchronizing for various purposes. Doing this is what will really kill your FPS. There should be, if programmed properly no reason to use more then one dbSync() call. When you do not turn sync on, your program will update immediately as fast as possible. Now say you have the sync turned on and the rate set at 60. Now if you call sync twice in the main loop, this reduces your FPS to 30. You can use 2D graphics, 3D graphics and even 3D animation with the sync off. If you don't believe me just try it out real quick in DBPro, that's what I do.

I am working on a DBPro plug-in, which includes some 2D functions. When I added support for different pixel depths, the dot function turned out to be no different from the native dot function. So, I ran some tests with Advanced 2D and found it to be no better. The only 2D functions that can really be optimized are the line and box functions. Again, if you're working on a text adventure, even with some 2D element, the native 2D functions should be fast enough.
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 15th Jun 2013 15:01
I have not been using the sync commands in DBP or DGDK. I tried the a2line command along with the native line command in DBP. I did not see any speed difference but then it was just one line. I set the lines to be red. The a2d line came out so dark you could hardly see it. The native line came out fine.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 15th Jun 2013 19:42
Quote: "There should be, if programmed properly no reason to use more then one dbSync() call."

Assume you have a lake that you want to reflect the environment around it.
You would then need to render the scene from the lake's "point of view", store that to an image and then texture that to the lake object for rendering by your "main camera". Point being, you would need to sync both cameras separately.


"Why do programmers get Halloween and Christmas mixed up?"
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 15th Jun 2013 23:13 Edited at: 16th Jun 2013 00:01
I have done reflections using only one camera. But for some camera tricks such as fullscreen bloom it would be necessary to sync more then one camera. So I will append that statement by saying, unless you're using a camera trick where you may need to render to more then one camera separately.

Dragon Slayer,

This is from the Advanced 2D help for a2line: "The line is anti-aliased by default". This is the reason it appears darker, but the line looks much smoother.
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 17th Jun 2013 04:28
Wicked I forgot about that! about the sync commands in DGDK. I have been having all kinds of problems getting things to run so I did a little experimentation with the sync commands. First off I have been commenting them out. I figured out that this was causing nothing to show up on the screen and a crash. If I use dbSync(off) and comment the sync rate out and comment out the sync at the end of the while loop I get the same results. If all the sync commands are in like they should be everything works so I guess I will be using the dbSync(off) before I do an input then turn it back on after. I guess this will have to work.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 17th Jun 2013 06:24 Edited at: 17th Jun 2013 06:53
You cannot simply remove the sync functions from a program designed to use it. Whether or not your program uses it, changes the whole ballgame. Tomorrow I will upload an example of how you would program the simple mouse over text based menu I used in Lopper without using the sync functions for comparison, so you can see how it differs. I'll post this in your DBPro thread titled "Any tips or help on using the mouse?"

Quote: "so I guess I will be using dbSyncOff() before I do input then turn it back on after. I guess this will have to work."


That's entirely up to you, it will work just fine.
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 17th Jun 2013 17:51
thanks! I have been trying the sync off and on but can't get things working right. I have a header file a CPP file and a main and a function stub to call and I can hit the 1 key and nothing then hit it again and it prints the statement in the function twice. I turned sync off before the input and back on after. I could be a placement problem. I am really new with classes and making and using header files I make but I have a pretty good understanding and don't have a problem in normal C++. I have looked at other graphic libs. Like SFML and SDL and still think this one would be the easy one to use if I could just get my head around the little B.S. stuff you have to Bo to use it effectively. this one also has 3D. those others you have to learn them for 2D then learn opengl for 3D. May as well learn the core language better and Jump into directX! Or stick with DarkGDK which is the option I like best It's just driving me crazy!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 18th Jun 2013 04:08
I have done DirectX programming. I have done SDL programming with OpenGL. I have used Irrlicht SDK. I have even done 3D animated graphics using the Windows API only. For functionality and ease of use, I have not found anything better then DarkGDK. As for the B.S., you will face these problems with any SDK, GDK or API you use. You have to conform to how the API functions are intended to be used and how the functions work together.

Login to post a reply

Server time is: 2024-03-28 23:48:36
Your offset time is: 2024-03-28 23:48:36