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.

Work in Progress / DarkGDK 2.0 Public Release Candidate

Author
Message
Mistrel
Retired Moderator
13
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 16th May 2012 01:26 Edited at: 16th May 2012 01:28
The DarkGDK 2.0 Release Candidate is out! Have fun and go nuts. It's free to try!

The current release is still in release-candidate status. However, the new website provides a download link for the full commercial version (for those accounts who purchase it) which does not expire as the beta releases have.

http://forum.thegamecreators.com/?m=forum_view&t=196865&b=22




Feature highlights:

All of DBP compressed down into a single DLL
Engine customization; basic 3D in less than 800 KB!
Future support is anticipated for additional programming languages.
Language agnostic interface; all exports are C function calls
Internal multithreading support. Go thread crazy!
Enhanced commands including true support for structured parameters
Potential support for rendering in a web browser
Rewritten, extremely fast 3D math library
Improved documentation for all DarkBasic Professional commands
Superior runtime error support that is thread-aware
Easy to use command line tools for automated compiling
Plugin-based parser. Adding support for your own language is a breeze!

Projects supported by DarkGDK out of the box:

Visual Studio 2010
Visual Studio 2008
Visual Studio 2005
Visual Studio .NET 2003
Visual Studio .NET
Visual Studio 6
GNU make/GCC g++
Nmake/VC++
PureBasic 4

This list is not finite! DarkGDK will "just work" with any standards-compliant C++ compiler. This includes any version of Visual Studio Express, g++, Borland, Watcom, Intel, Comeau, etc.

The new engine is extremely lightweight and highly customizable. And best of all, it's fully compatible with DBP's plugins. Now you can enjoy the power of DarkBasic Professional from your favorite language. And if you have multiple favorites-- no problem!

Program using your favorite IDE. Any IDE. Any language!

DarkGDK: Project Setup in Visual Studio 2008



Screenshot of DarkGDK and the PureBasic IDE:



Screenshot of DarkGDK and the Qt Creator C++ IDE:



Here is a video of a C++ example project being run and debugged from the Qt Creator IDE. It also demos the flexibility of DarkGDK by compiling from a UNIX (cygwin) command line using Make and the GNU g++ compiler. It should work with most any C/C++ compiler.

http://darkgdk.com/files/upload/TGCForum/pgdk_cpp_demo_xvid.avi

Brand new language-specific documentation!





Here is a screenshot of the DarkGDK documentation for a comparison:



The documentation is in the excellent .chm format with an index and full text search.

All source code and templates for the documentation builder will be available in the SDK for you to help extend the existing docs and also for you to apply to your own projects if you like.

Many of the commands have been renamed for clarity and others have had their parameters reordered to support default parameters and function polymorphism.

Here is an example of a function which will have its parameters reordered for automatic ID allocation:

Quote: "
dbLoadSound(string fileName [, int soundID])"


The "soundID" parameter is optional and therefore appears at the end of the function. If no ID is specified, one will be returned as the result.

For functions which take advantage of default parameters, the header might look like this:

Quote: "
dbLoadSound(string fileName, int soundID = -1)"


And for others which use function polymorphism, for example:

Quote: "
dbLoadSound(string fileName)
dbLoadSound(string fileName, int soundID)"


Another example where a command might be different is "dbSetDisplayMode".

In DarkGDK you can use these commands to change the resolution:

Quote: "
void dbSetDisplayMode (int iWidth, int iHeight, int iDepth)
bool dbSetDisplayModeEx(int iWidth, int iHeight)
bool dbSetDisplayModeEx(int iWidth, int iHeight, int iDepth)
bool dbSetDisplayModeEx(int iWidth, int iHeight, int iDepth, int iMode)
bool dbSetDisplayModeEx(int iWidth, int iHeight, int iDepth, int iMode, int iVertexProcessing)
bool dbSetDisplayModeEx(int iWidth, int iHeight, int iDepth, int iMode, int iVertexProcessing, int iLockable)
bool dbSetDisplayModeVSync(int iWidth, int iHeight, int iDepth, int iVSyncOn)
bool dbSetDisplayModeAntialias (int iWidth, int iHeight, int iDepth, int iVSyncOn, int iMultisamplingFactor, int iMultimonitorMode)"


In DarkGDK the same command with optional parameters is:

Quote: "
dbSetDisplayMode(int width, int height[, int depth [, int vSync [, int multiSampling [, int multiMonitor [, int backBufferWidth [, int backBufferHeight [, int vrMode]]]]]]])"


In this function each parameter after width and height can be optionally specified.

DarkGDK has built-in support for multithreading by providing function-level critical sections for your convenience behind the scenes as well as thread-aware error handling. Each function can have several possible error codes which can be detected are caught at runtime for you to examine and respond to.

For example, dbMakeMatrix() can throw any of the following errors for you to catch with dbGetLastError():

Quote: "
kGDK_Error_3D_Matrix_ID_Invalid
kGDK_Error_3D_Matrix_Exists
kGDK_Error_3D_Matrix_Segment_Invalid
kGDK_Error_3D_Matrix_Dimension_Invalid
kGDK_Error_3D_Matrix_Too_Large"


dbGetLastError() will return the last error to occur in the current thread. It can safely and accurately be used across multiple threads.

Never have to use a vector or matrix "ID" again! DarkGDK supports vector and matrix datatypes as structures. This means that you can access any part of this data and they can be written to and read from memory:



How to write a library builder plugin for your language:

The library builder (buildlibs.exe) tool handles all of the template parsing for you and will automatically compile headers for any language which has a plugin to generate it.

Command line parameters for buildlibs.exe are:



Here is the source code for gdk_purebasic.dll. This plugin has been written in C++. The code should be fairly easy to read but I'll be happy to answer any questions you may have. The "Version 1" specification may change between now and the final release:

Version 1 Plugin Specification:



How to run the examples:

The DarkGDK installer should automatically generate header files as well as build a complete engine .dll from all of the DarkBasic Professional core libraries. If you need to generate these files again, there are batch files to automate the process in the DarkGDK install directory.

If you cannot run the examples for some reason, try to generate the headers and the engine .dll again using these batch files. If they do not report a success then please submit a report on this board as a bug.

All examples located in the install directory under the examples folder should compile out of the box without modification.

One major difference you must be aware of is that DarkGDK does NOT use "DarkGDK()/LoopGDK()". It can use whatever entry point you want, be it main(), WinMain(), _tWinMain(), etc:



Unlike DBP and DarkGDK 1.0, in DarkGDK 2.0, the renderable area is separate from the actual window. As you can see from this example code, dbOpenScreen accepts a target window handle "hWnd" which tells it where to render the output. This allows DarkGDK to render to "any" window owned by the process and is not limited to any one implementation.

For example, you can use DarkGDK with GLUT, Qt, Win32, wxWidgets, etc.

There are a lot of changes compared to DBP and the old DarkGDK. It is not targeted as being 1:1 compatible with older releases of DarkGDK and there will be growing pains while you encounter the differences. However, the idea behind DarkGDK 2.0 is to bring evolution to the engine to streamline it and in the end make it easier to use as well as being portable to other languages.

Don't forget! DarkGDK is also compatible with all DarkBasic Professional plugins and includes many headers to provide support out-of-the-box. An SDK is also provided which allows anyone to add support for additional languages!!

haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 09:34 Edited at: 16th May 2012 09:38
registered
but when i execute the downloaded file it dosent work
and the download is only like a few kilobites.. so i dont know whats wrong with it.

the file weight 0.0 kb.. wtf ?

also what is the time limit i can use it?
or is it free for unlimited use ?
prasoc
10
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 16th May 2012 14:42
Personally I'm rather excited at thie massive update. I've been using DGDK for years, and I've basically had to work around non-threading bottlenecks, bad ID system (with no OO, had to create my own classes for it), function definitions that don't exist, etc. I can't wait for the full release! Being able to use plugin libraries from DBP will be a huge bonus, just hope Sparky's collision DLL will function on the new release. Its only $60, thats really cheap for what you get.
Olby
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 16th May 2012 16:07 Edited at: 16th May 2012 16:21
Quote: "the file weight 0.0 kb.. wtf ?"

Same here, probably a corrupt file.


Quote: "just hope Sparky's collision DLL will function on the new release"

Yeah it works out of the box - at least all previous betas and release candidates (under the name of PureGDK) had the SC collision commands wrapped.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.60 + PureGDK 2.0

Attachments

Login to view attachments
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 17:23
there is no initDarkGdk.h file in the installer so
it dosenot work.
prasoc
10
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 16th May 2012 17:31 Edited at: 16th May 2012 17:31
haliop, I had to find it (it's not included in the "Application Data" shortcut). go to "C:\Program Files\DarkGDK\examples\projects\c++\include" and the header initDarkGDK.h is there (located in the example files!!)
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 17:58 Edited at: 16th May 2012 18:02
found the initDarkGDK.h file.

so many functions are missing! i need to rebuild my project from scrap
i think this was a bad idea!

where are all the files , directory commands?

dbObjectExist turned into dbIsObject
alot of changes but some functions are missing and im stuck with it cant go on any further

this really sux.. sorry to say it but thats the truth
i think you shoulnot have released this beta yet,

should i revert to the old GDK ? well i dont want to.
i will have to rebuild project M almost from scrap and thats sux.

also no dbRnd commands, man why release it !? why ohh why did i deleted without backingup why!?!!!! ahhh
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 19:59
so i changed everything needed to be change
but
i get this error

fatal error LNK1104: cannot open file 'darksdk.lib'

what now ?
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 20:17
ok i removed the old sparky collision i used and it works only without collision how do i use sparky collision with this beta?
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 21:33
another problem i found is with images and images loading
i do not know exactly where to point this problem
but i think that there is something wrong

cause i checked the debugger my objects are textured correctly when looking on the commands but in game they are not i think something is messed up or something dont know..
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 21:41 Edited at: 16th May 2012 21:53
ive just checked , the image is loading correctly
so maybe its a texture object problem

edit:

well hmm i dont know but something is wrong

or the texture object or load image
there is a problem with one of them.

on some objects it texture correctly but on other it is messed up.

Edit:
i suspect its dbLoadImage that has a problem
after texturing my object with diffrent textures
and just some spechific textures dosenot work
however it does show as it did load them i checked with
dbIsImage .
prasoc
10
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 16th May 2012 21:57
Images not displaying correctly? The parameters for dbLoadImage() have been switched around so that ID can be left blank (for OO)

Old DGDK: dbLoadImage(FileName, ID, TexFlag);

New DGDK: dbLoadImage(FileName, TexFlag, [ID]);
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 22:01
also a very wierd problem that never happend to me before

its possibly something wrong with my code i dont know why this is happening



simple for loops right
well , the debugger shows that even after k gets to 3 it continues to loop again making a violation acess problem.

hmm... never happend to me before.
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 22:05
Quote: "Images not displaying correctly? The parameters for dbLoadImage() have been switched around so that ID can be left blank (for OO)

Old DGDK: dbLoadImage(FileName, ID, TexFlag);

New DGDK: dbLoadImage(FileName, TexFlag, [ID]);"


yeah i changed everything..
but still..
its a wierd problem
ive added another texture to load
and suddenly another object which didnt textured right before now texture ok .. again a random object texture is working only cause i added another texture load before its texture... its messed up dont know what the problem is ...
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 22:09
FOUND IT!!!!!! hip hip horray




ok i am using a GetFreeImage function i created


so actually the numbers just increasing

i changed it to


my guess is , that some image ids do not work right.
maybe the first image ids have a bit of a problem dont know.. maybe

but now when i start it at 100 it works right.
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 23:03
i also got this error :


Windows has triggered a breakpoint in M.exe.

This may be due to a corruption of the heap, which indicates a bug in M.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while M.exe has focus.

The output window may have more diagnostic information.

--------------------------------------------------------
i highlighted alot of my code just trying to get this to work
i think the beta files do not work correctly.
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 16th May 2012 23:37 Edited at: 16th May 2012 23:39
and another thing i found out

using visual c++ 2008 express

when i debug the project slowly from point to point the game does more then when i run it without points..

the error i get is:

Unhandled exception at 0x046c2023 in M.exe: 0xC0000005: Access violation reading location 0x000007e0.

and it shows in the code that it stucks here:

i am extremly tired, its 23:38 and from the posts you can see how much time spent on tring to move on to 2.0 beta..
GDK developer , pls response.
at file : dgdk-darkgdk.cpp
Olby
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 17th May 2012 02:04
@haliop: Could you please edit your existing posts as it is hard to read and reply when there are so many double posts.

Speaking of the commands, some of them have been renamed for consistency with other commands and some have been removed because they overlap, for example why would you need to use dbRandom() if you can use the native command in your language of choice.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.60 + PureGDK 2.0
haliop
10
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 17th May 2012 10:56
yeah i had no idea there is a rand() command in c++ im a beginner
i used all GDK commands cause of lack of knowledge about the native commands.
yesterday i learned about some native commands and strings which i never used before.
Mistrel
Retired Moderator
13
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 25th May 2012 09:37
If you have a question about DarkGDK 2.0, the best place to ask is on the DarkGDK board where more people can help you.

If you believe you are experiencing a bug then you must provide a reproducible code snippet that highlights the problem.

Login to post a reply

Server time is: 2019-08-19 08:26:09
Your offset time is: 2019-08-19 08:26:09