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 / Issue with objects being lit when changing screen size.

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Dec 2013 17:29
I'm just getting to grips with GDK, and I have an issue with objects being lit when I change the screen size.

This is the example code i'm using:


The object appears unlit, with a constant colour. (No shadows/highlights.)

If I comment out the line: dbSetDisplayMode( 1336, 768, 32 );
then I have a properly lit object?

Can anyone shed any light (get it??) on this for me?

And also, how can I switch the program to be fullscreen windowed? My minds a blank!

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Dec 2013 18:40
Sorry for bumping my own thread, but ignore the windowed desktop issue, I've sorted that, but I still have the lighting issue to fix...

The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 12th Dec 2013 19:11
I tried your code using DarkGDK 2007, 2008, 2010, and the open-source version I have. They all work the same way, and I cannot duplicate your lighting error. The box appears shaded as it rotates, as your code is. Commenting out your resolution change isn't necessary. Since it is a non-standard resolution, maybe it's your video board? Try using a more standard resolution and see what happens...
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Dec 2013 19:17 Edited at: 12th Dec 2013 19:22
It is a standard resolution. It's the native resolution of my laptop...


edit: Oh, this code seems to work...



The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 12th Dec 2013 19:35 Edited at: 12th Dec 2013 19:49
Good gosh!

I noticed one difference in your two versions there - you've transposed the display mode change with the sync commands.

Edit: Are you using the open-source version? To get a working starting point, r65, having to do with lights, was one of the revisions I rolled back sight unseen (get it?), because I found some other similar revisions to be quite buggy; also I hate Microsoft's funky libraries and mangled/managed code and all its restrictions and clutches, which that (r65), among other revisions transitioned to.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Dec 2013 20:05 Edited at: 12th Dec 2013 20:08
Moving the dbSyncOn(); dbSyncRate( 0 ); dbSync(); commands back above the display mode comandns didn't affect anything, I've just checked.

I don't know what the issue was, but it's fixed now.

And I'm using the awesome template MadBit provided for Visual Studio 2012 here I don't know what version of DBPro it's based on, but it might be an early version as Reload display pointer is missing.

(And strangely, dbAutoCamOff() gives me a blank screen..)

The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 12th Dec 2013 20:48 Edited at: 12th Dec 2013 20:54
Nice! I wasn't aware someone had gotten it to work with vs2012, and it's great he's distributing it! I'm still using vs2008

The open-source version, as it is, is very buggy though. There are severe memory leaks, and the latest camera revision significantly slowed down rendering speed. And some of the commands won't work. If he didn't roll back (or fix) all the buggy revisions, then it's going to have some problems. I know how frustrating that can be, too, when you're trying to learn something new...

For dbAutoCamOff(), try setting the camera position manually, and see if you get your cube back. I never use the auto cam functions anyway.

dbPositionCamera();
dbRotateCamera(); or dbPointCamera()

Do you have the documentation file ("Dark GDK.chm")? It hasn't been updated since 2007, and there are a number of undocumented commands (you can find their prototypes in the .h files). But it helps.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Dec 2013 22:07
I have the documentation as I have the Dark Game Studio package, but I haven't installed it as the VS2012 version doesn't require installation, just a copy & paste.

I hope it's not too buggy as I really want to keep using GDK as no companies I apply for jobs for give a damn about DBPro. (Unfortunately.)

The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 12th Dec 2013 22:31 Edited at: 12th Dec 2013 22:44
I've never used DBPro, but the two use the same commands and source code, so that should make it easier to transition.

I'm not sure what came with the Dark Game Studio package, but here's the DarkGDK documentation file that came with the original DarkGDK 2007 release. I still refer to it as a quick-reference. I've noticed in a few cases if you paste in commands from the documentation, the compiler doesn't recognize them. This is because of capitalization errors in parts of the documentation. The compiler is of course, case sensitive.

And yeah - C is much more widely used than BASIC. I got my start with BASIC in the '80s. When I leaned C, my prior knowledge of BASIC helped a lot. C is a bit of a different paradigm though. It's modular and more efficient and performs better, and you can do more with it.

Actually, if you just download the original 2007 package (it's still up there), or install it if they included it in the studio package, there are several samples they included also.

Edit: You can use Universal Extractor to extract the files without going through the installation process. That way you don't have to worry about it screwing with your settings (I don't think it affected your settings anyway though). Within the DarkGDK installation .msi, there's an .exe. Re-run the extractor on the .exe, and the files will be there, and you can paste them wherever you wish.
http://legroom.net/software/uniextract

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-28 11:08:16
Your offset time is: 2024-03-28 11:08:16