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.

DarkBASIC Professional Discussion / Need help Converting and Debugging DBPro to C++ with DarkDGK. Mainly Datahandling.

Author
Message
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 30th Nov 2017 05:51 Edited at: 30th Nov 2017 05:59
Is anyone Willing and able to help me out here a little bit. I got my code I am converting over from DBPro to C++ Using DarkGDK but my C++ is rusty to say the least being about 15 years or so since I have used it and even then the last time I had used it was TURBO C++ so my windows programming is almost non-existant. I know the basics but DarkGDK makes alot of that easier since I don't have to deal with Window Management and Device Context.

However I am coming up with a few issues when attempting to convert it. The program runs... But its off. First of all I am not passing my values correctly I don't think because my int _MAKE_CREATURES() function is producing totally random results that I do not understand.

+ Code Snippet


On top of that the value EXIST in my Struct on every single element keeps getting set to TRUE and I don't really know why. That is causing me serious issues. Its odd because non of the other Values are getting changed. I initialize Half of the Array from the start but when I attempt to add more to it this function above does not work. I am assuming its a glaring error on my part.


I am calling it from my _BREED() function like this


int X = _WRAPX(CREATURES[creature1].X + (rand()%3) - 1);
int Y = _WRAPY(CREATURES[creature1].Y + (rand()%3) - 1);
int COUNT = _MAKE_CREATURE(X,Y, 1000, ANGLE,(rand() % 2),SPEED,COLOR);



My other functions, on the surface anyway seem to be passing the correct values so what am I doing wrong here and how does EXIST always go to TRUE... Is it because of my testing method

int count = 1;
while(CREATURES[count].EXIST){count++;}

I do this to find a free ID in my ARRAY because I am going to be adding and Deleting elements rather fast. I KNOW there is faster and better ways to do this in C++ that I will find in time but Im currently just trying convert this over word for word at the moment yet any suggestions would be awesome.



Also.... I do not know how to print using Dark GDK. COUT<< does not show up nor does PrintF... only the dbPrint() command does but I keep getting issues trying to do so telling me no override function for this. I mainly just want to know of a way to use Printf or Cout normally.


Hmmm What else....

Oh.... there seems to be no dbLockPixel command so I wonder if LockBits can do the same and if so how?



I know down the line I should Convert all my creatures over to a class object with there own methods for handling all this data but I am not at that point yet. I just want to get this working. It currently Starts but they end up dying on me and are not moving around yet. Im sure I will have them doing that by the end of tonight though.



PLEASE Everyone I need help getting back on this horse, I seem to be seriously messing up on data handling here but am just not 100% sure how. I know I use to pass variable as pointers in functions but really dunno what I am doing anymore.

Thanks for Anything, I am all ears, take a minute to glance over my source and any comments will be helpful I am sure.

Full DBPro Source Code

+ Code Snippet




VC++ Code Using DarkGDK


+ Code Snippet
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 30th Nov 2017 10:32
So I managed to get the code into much MUCH better shape, almost all of my code is centered around manipulation of the creatures so I just turned them into an object and set the methods to go with them. Here is the Creature class below. I am still having some problems with it. First of all the DATA still is not going in correctly and I am unsure why. EXIST ends up getting flagged for every instance no matter what. This is making it impossible for me to tell if a creature is alive or dead causing all sorts of issues.

AGE HEALTH and LAST_BREED along with EXIST are all getting values when I have not initialized them. I have tried to clear them but nothing is working. Its not random Giberish I don't think so whats going on?

I know my data handling leaves alot to be desired thats why I am here asking for you guys help. Everything seems good except for the Arrays.

I need that EXIST flag else I can't initiate new instances because I need to keep track of what creature IDs are free to prevent population of creatures from exploading.


The Code is so much better and easier to deal with now that I got the Class handled. If not for this stupid issue with the Arrays I would have been on my way hours ago.

Another thing that could possibly work, Is there a means to find a free element in an array, Or just cycle through all existing creature objects so that I don't have to make an array and can add or remove them at will? That would insanely simplify things. Not to mention speed it up.

Oddly, I am not getting a HUGE speed boost over DBPro to be honest, I mean Its not bad and definitely faster but not 2-3 times faster as I expected. Still a lot of room for improvement. The main Benefit and why I moved to C++ anyway was because I really needed to pass UDT around to make data management easier and yet here I am having issues with that very thing.

CREATURE CLASS

+ Code Snippet


Rest of Main.CPP
+ Code Snippet


The Main.h Header File

+ Code Snippet
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Ortu
DBPro Master
10
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 30th Nov 2017 17:45
I'm not very familiar with c++, but:

Doesn't equality test use == ?

if(CREATURES[ID].EXIST= 0) ---->

if(CREATURES[ID].EXIST == 0)

Also aren't bool values 'true' and 'false' ? Does c++ implicitly type cast?

if(CREATURES[ID].EXIST == false)

It also doesn't look like the creature constructor sets exist = true or = 1 anywhere
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 30th Nov 2017 19:49
YES!!! Thank you I forgot all about that Duh!!!

I just fixed it but I ended up creating a Getter Method for the EXIST member and setting it to private so it could not be accessed...

Until I just read that I could not for the life of me figure out why every time I checked the value it was setting it but I clearly remember now and feel kind of stupid lol. Told you its been a minute since I used C++. It explains some other errors I have been getting about needing LOperands also.

Quote: "It also doesn't look like the creature constructor sets exist = true or = 1 anywhere"

It didn't, I eliminated the code to do so which is why I was ripping my hair out trying to figure out why it was getting set to TRUE. It was doing so during my check because
if(CREATURES[ID].EXIST = TRUE)
Is checking to see if the operation of setting the value to True worked. IE I believe I would only get a return of FALSE in that statement if for whatever reason it could not allocate memory and set the data for EXIST. It was not checking the member it was setting it and then checking to see if setting its value worked correctly. Its so clear to me now that I read that. Would have saved me making everything private and designing my getter function like I just went and did.

My only issue I have now is I can not figure out if there is a way to use STD::COUT while using DARKGDk. Its just so much easier then attempting to combine various strings together. I seen we have a DarkGDK board here but it seems extremely inactive.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Ortu
DBPro Master
10
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 30th Nov 2017 21:22
Support for gdk was dropped many years before even support for dbpro was dropped. Gdk user base was never as large to begin with either.

There also used to be a really handy "other languages" board that had some c++ activity but I think that was dropped in the forum updates a couple years ago.

gdk is a bit of a niche within a niche within a dark forgotten hole I'm afraid
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Hotline
9
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 1st Dec 2017 01:24 Edited at: 1st Dec 2017 04:55
Quote: "My only issue I have now is I can not figure out if there is a way to use STD::COUT while using DARKGDk"


You could try changing your project's subsystem to CONSOLE (in Configuration Properties/Linker/System) this enables the console where you can use std::cout but i'm affraid GDK's compiler settings are so awkward it wouldn't work.If it works you're lucky and you owe me a beer !

EDIT : You could add the following line as the first line beginning of your source file.

#pragma comment(linker, "/SUBSYSTEM:CONSOLE")

you can even combine it with

#ifdef DEBUG_VERSION
#pragma comment(linker, "/SUBSYSTEM:CONSOLE")
#endif

So if you define DEBUG_VERSION then the console will appear If not defined the app will run without console.

This is still untested with GDK !

Quote: "Oddly, I am not getting a HUGE speed boost over DBPro to be honest, I mean Its not bad and definitely faster but not 2-3 times faster as I expected"

GDK is DBPro.Same slow functions like dbMakeObjectBox or dbSprite , etc. If you want real speed boost you might need another engine.
[href=forum.thegamecreators.com/?m=forum_view&t=191567&b=5]Spark Particle engine[/href]
[href=forum.thegamecreators.com/?m=forum_view&t=199163&b=5]Transform gizmo plugin[/href]
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 1st Dec 2017 03:00
The standard iostream function – COUT; does not work in a windows application. The C++ string class works nicely for string manipulation. To print use the dgdk function dbPrint.

+ Code Snippet

You could if you want, get the device context to the backbuffer and use the windows api functions TextOut and DrawText. It is best to avoid using dgdk string functions altogether.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 1st Dec 2017 06:15 Edited at: 1st Dec 2017 06:20
Quote: "GDK is DBPro.Same slow functions like dbMakeObjectBox or dbSprite , etc. If you want real speed boost you might need another engine.
"

I know but I only need to plot pixels and for that once I wrapped my main game loop in LOCKPIXELS and UNLOCKPIXELS command in DBPro is was surprisingly fast, over double then without it. I could only imagine if there was an equivalent DGDK command but i have yet to find one.
[EDIT] Nice I just found dbLockPixels, I had the Case messed up and its not online on the reference for DGDK so I thought it didnt exist.... Thats awesome.


As far as the speed boost, Its running well enough now, I mean Its already running faster and I have not even been able to use something like LockPixels like I can in DBPro... Not to mention I am using straight Trig functions which in my DBPro program I make look up tables. When I use LockPixels in DB the speed over doubles so I could only imagine what would happen if I could do that here,....
I have not even begun any sort of optimisation and all ready see a nice improvement so I am not stressing speed right now just want to get it working like it should. The real power of C++ honestly is the fact that you can almost ALWAY optimise your code a little bit more., All the way down to taking out or changing a single ASM command that might be slowing it down...

Which brings me to my next question. How would I get the DC of the BackBuffer? I am kind of confused exactly what DarkGDK is doing, Its nice for quickly prototyping and getting working code on the screen but horrible for optimization. If I new the DC of the Backbuffer I could use LockBits and surely get a huge speed boost to the program.

I was just going to use cout due to its ease of string concatenation. Printing to a console would be even better if I can get that to work since Its really only debug information I wish to view during runtime anyway.

#pragma comment(linker, "/SUBSYSTEM:CONSOLE")
Quote: "1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(268,5): error MSB6006: "link.exe" exited with code 1120.
1>C:\Users\Curt\documents\visual studio 2010\Projects\GDKLife\Debug\GDKLife.exe : fatal error LNK1120: 1 unresolved externals"

Good idea and would be nice to have the Console up and running but yeah... it wasn't having that. It prob has something to do with how DGDK handles its main function since entry starts at a function called
voidDARKGDK(){
instead of standard int main(){}

I have it working good now, main issue is the way that I create new objects, I know there has to be a better way then cycling through an array of Class Objects and Adding and Deleting Elements as needed because I have seen people do it. I believe it was the LIST command or something like that, I cant really remember but he dynamically created and destroyed elements and when it came time to call the Draw method to his objects those in existence all updated themselves. That would be perfect but sadly I am WAYYYY behind the times. I mean hell C++2.0 was only like 6 or 7 years old when I was using it so ALOT has changed.... for better or worse.


The entry bar looks much much higher then it was back then.



Quote: "gdk is a bit of a niche within a niche within a dark forgotten hole I'm afraid"

Thats a damn shame because this has been the easiest I have gotten a program up and running yet. No need to worry about anything and it causes a C++ program, other then syntax, to play out like a BASIC program, you just start it up and forget about all the bullshit behind the scenes,(for better or worse). I could with ease seeing something like this becoming very very nice if it were made more powerful.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Hotline
9
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 1st Dec 2017 09:55
That's exactly what i was affraid of. Since you can only work with hardcoded void DARKGDK() (which is most likely a simple wrapper over LRESULT WinMain() ) your hands are tied.In normal circumstances you can create window handling as a separate module and still use int main() as your main entry point.This way you can have the standard std::cout in paralell with a window app.This is how in every possible game engines are doing it.

[href=forum.thegamecreators.com/?m=forum_view&t=191567&b=5]Spark Particle engine[/href]
[href=forum.thegamecreators.com/?m=forum_view&t=199163&b=5]Transform gizmo plugin[/href]
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 1st Dec 2017 19:51
I was following a Tutorial for the SparkyGameEngine by Cherno and we created a window, was able to draw to it using OpenGL and even in that Window that we made the Consol ran in the background but we were able to use COUT<< to the graphics window we created. That seems to go against what WickedX stated above, Now we did not explicitly tell it that it as a Win32 Application, I generally don't use the creation wizard opting for just creating a blank project and setting up my windows class to initiate a new instance of a window and go from there. Doing so Indeed allows COUT to work which is why I was kind of confused when it did not work in DarkGDK.


I suppose with all that being said I don't see why I shouldn't be able to do the same here. I don't really know HOW it decides what window to writ e to however.

I have been watching a series by JavidX and he has made an entire game engine using nothing but the Console window. Its really really friggen cool and I would suggest everyone look it up on youtube.

But I believe I remember him doing something to initiate an instance of the Console window which makes me wonder if I can hard code something to allow the Console to show up.

I got everything working last night aside from the fact that all my creatures Clump up into a ball for some reason now lol. IDK if my collision detection is off or what but I believe it might have to do with precision and the fact that I am sure everything I am using is float yet in BASIC I am sure I am losing data somewhere.




As far as speed.... oh baby... lol. I stress tested it last night and found 20k creatures running roughly the same speed as 1000 was. Not getting to excited about that until I can figure out whats up with their movement but damn Thats Alot of little buggers running around and exactly what I needed from the start of this project
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Hotline
9
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 1st Dec 2017 23:05
Quote: "I suppose with all that being said I don't see why I shouldn't be able to do the same here. I don't really know HOW it decides what window to writ e to however."

No.My solution works only with the default console window.If you want to draw debug data in the win32 window then yeah , WickedX's solution is for you.Howewer there is another solution by allocating another console window (AllocConsole FreeConsole , etc) and redirect the standard std::cout , std::cin to output into this new console.So you still have a chance to use the console in your GDK app
Regarding to cout << to a win32 window , this would also require to overwrite your standard output and use it as a wrapper over WinAPI's DrawText.But this is really ugly hacking so i would suggest to go with WIckedX's solution if you want to write debug information in the win32 window
[href=forum.thegamecreators.com/?m=forum_view&t=191567&b=5]Spark Particle engine[/href]
[href=forum.thegamecreators.com/?m=forum_view&t=199163&b=5]Transform gizmo plugin[/href]
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 8th Dec 2017 02:07
HOTLINE, Something I just noticed that I found interesting.... When a DGDK program is ran so is ConHost.exe. In other words the Console is still made and is running but its hidden.

WickedX, I seen in some post in the past that you have done some work on DGDK, How exactly is the console handled? Can I just make it visible again, I don't see why not, I would just need the Handle right?
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Dec 2017 03:44
I'm getting no additional instances of the console host, running a dgdk application.

I have used Hotline's other solution in the past, using the windows api console functions (AllocConsole FreeConsole , etc). Check it out @ https://docs.microsoft.com/en-us/windows/console/console-functions.

For data handling check out the standard template library. Here's an excellent demo of using vectors by WLGfx. https://forum.thegamecreators.com/thread/195112
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 11th Dec 2017 08:49
It was running under the task manager. It was def linked to the VC++10 program I was running.

Ty for the link, Given what I mostly program Vectors are something I have been meaning to work with since I feel making a list object out of them might greatly improve performance.

I just converted my Life program over to SDL earlier and so far DarkGDK out performed it by a mile...

I think with some tweaking I will get SDL to work as well or better(I mainly had to convert because I am about to receive help with it and sadly no ones really heard of DarkGDK) I wish DarkGDK was never abandon. I believe DGDK would have been better the al ot things like SDL with a little more effort.

SDL does give me the ability to use the console though but I do need to focus more on learning better data handling.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 12th Dec 2017 03:12 Edited at: 12th Dec 2017 03:14
I remember using SDL in FreeBasic and XBLite. Ya, that should work nicely. Since the source for both SDL and DGDK are available, you can easily fix the error you find and add functions. This is what I did with the DarkGDK - Unofficial Updates. I remember an old phrase somewhere “C++ For Control”, this cannot be so true. You're not tied down to someone else's idea of how things should work, if using pure C++.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 12th Dec 2017 17:37
I may try my hand at tinkering with DarkGDK soon myself. I would love to be able to do more with it. I understand that for most simple projects its prob best to alter the main but I really wish I could use the functions contained in it without it doing anything else. Given that its prob setup to handle a specific Window and Device context IDK how easy it would be to manage something like that though.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Dec 2017 03:55
DGDK has a host of internal functions you can access simply by declaring the function in your code. You can add, subtract or completely alter the render cycle. You can also redirect the output to another window or a child window.

Anyway, here is a short solution to using cout in a console created in DGDK.

+ Code Snippet
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 13th Dec 2017 05:34
Will that work in the main loop though?


See I just notice this....

void DarkGDK(){
dbPrint("hello");
system("PAUSE");
while(LoopGDK()){
dbSync();
}
}

Will produce the console for an instance but this goes away when the LoopGDK() is called. Now our DX window is created before the System Command is called si i am assuming this takes place in the Headers somewhere(but where? I need to know to make this compatible with other Libs). Placing the system command in the game loop calls it every time system("PAUSE"); is called yet destroys it when LoopGDK is called. You sure this won't shut off our window as well since it may just be turning off the console that has focus.

I mean your prob right but I was just curious if that's the case. I started poking around the DarkGDK header files earlier to get a feel for whats contained in it and think I am going to delve more into the Source very soon. Like I said its say, I have used a few different libraries now and I honestly don't like any of them as much as I like DGDK. Yes it could use some upgrades and give the user a little more power but shit... its old as hell compared to some of these other libraries and does not have a team of open sources ripping through it on a daily basis.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Hotline
9
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 13th Dec 2017 08:19 Edited at: 13th Dec 2017 11:00
GDK was great 15 years ago.In the dark ages of modern game programming (2000-2002) was nearly impossible to find free tutorials or books about the topic.And even if you did find something it was made by a guy who was in the same boat as you and the lack of information a long path of trial and error ended up in "tutorials" which were so illegible and cumbersome that most enthusiasts just gave up and found another hobby (Probably the century's bigest increase in number of stamp collectors)
Not only the tutorials were badly written but for some reason everyone insist to write code in combination of C and low level API's like WInAPI and Direct3D or OGL which ended up in abominations like this :

P_WPGHU_PTR_UINT_BLAH * ptr_ = NULL
J_RT_GSCV_INT32_CBG_ * p_jrt_gscv_ = NULL;
malloc((INT*)&*(float*) * sizeof(J_RT_GSCV_INT32_CBG_ ) , ((*void)*)instanceptr_ , (arr[g][c])(arrayptr**)&(DWORD*));

It was like disco in the 70's ! Everyone knew it was bad, still everyone was doing it
Then DBPRo and GDK came along... Everyone was excited and everyone liked it.The crude simplicity of "make object box"'s and "Print "hello world"'s were so insanely easy to learn and understand that right after a few days everyone was saying "yep , that's what we all waiting for ! Take my money and shut up!"
Unfortunately after a short time the DBPro coder's bigest enemy showed up : >>> WORKAROUNDS <<<. Yes. It was clear as day.The simplicity has it's price. But that was just the beginning.Since 3d programming , linear algebra , shader programming , are so complex subjects that you can't actually simplify them to "make object box" level , so the first "addons" showed up. But the nastiest thing (in my opinion) was hiding in the shadows till 2008-2009.The thing that made me (and possibly everyone else) to quit DBPro and GDK.The procedural programming paradigm.Don't get me wrong it has it's place in software development , i just don't think game programming is one of them.No matter what i did once my code started to gain in complexity the whole source turned into an illegible spagetti mess and i had to start everything over and over and over.Like an infinite loop of failures.And just for the record : the annoying bugs didn't made coding easier either.
So after 2008 the community started to fall apart and people started searching for something different.Users simply lost interest in Basic.It just doesn't work well for game development.However It's great for some other tasks.

So this is the DBPro's short history from my point of view.There are bunch of other alternatives right now.I don't want mention names here you can probably find them if you want (No , it's not irrlicht and ogre...).Most of them are open source , and all of them are free.Targeting newer hardware , different platforms , have wonderful world editors and other tools.I always wanted TGC to push DBPro in this direction , unfortunately they didn't.
[href=forum.thegamecreators.com/?m=forum_view&t=191567&b=5]Spark Particle engine[/href]
[href=forum.thegamecreators.com/?m=forum_view&t=199163&b=5]Transform gizmo plugin[/href]
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 14th Dec 2017 03:17
I believe the console is activated only to display “Press any key to continue . . .”, soon as you press the key the console is destroyed. DarkGDK's entry is WinMain, this is for a Windows GUI application. What I would do is allocate the console and use the string and windows api library functions available. I removed the LoopGDK() in the snippet to simplify the code. The console is persistent till destroyed.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 20th Dec 2017 05:59
I have run into a road block that others seem to have as well. However solutions they used are not working so well this day in age from the looks of it.


I have a mess if these sort of errors...
+ Code Snippet


A list of these type of errors in normal /MD mode
+ Code Snippet

This is the result of attempting to put it in release mode as others have tried...
+ Code Snippet

The above also results from #undef _DEBUG



IDK I am stuck. If I come up with a solution Ill gladly report back but I can't seem to get this working.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 23rd Dec 2017 06:03
I just realized I did not specify what was causing these errors....


Its an attempt at using the VECTOR library in C++. I really really need to use vectors as it will speed my program up BIG TIME.... I really dont want to deal with setting up a linked list if I can avoid it and using a vector would be a walk in the park but sadly you cant use the Vector library with DarkGDK due to the errors above. I cant seem to fix it which totally blows.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 23rd Dec 2017 16:02
Dark GDK debug libraries are not really designed to use C++ debugging features all that well. I only compile in release.

Now, you have sparked a memory. This may be the reason I started using only the Game Wizard. I'm totally lost as the why this is, the project properties are identical. But, I have had issues using the 2D Game and 3D Game Wizards.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 28th Dec 2017 17:12
You have issues with the game wizard or only use the game wizard? Sorry it wasn't clear.

I really wish I could give DarkGDK a complete overhaul because I really like it regardless of what people tend to say about it. I think with an Update it could be made rather powerful but I am just not a competent enough coder at the moment to do so. Soooo much time is utterly wasted attempting to use other graphics libraries. I have spent the last 3 weeks attempting to learn SDL just so I can lock a friggin texture and put a pixel on the screen when the same commands in DarkGDK are...

dbLockPixels
dbDot
dbUnlockPixels.

Windows programming has serious over complicated itself. All these APIs are made to simplify life but it seems they have the opposite effects. They ruin performance and over complicate simple algorithms.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 29th Dec 2017 03:59 Edited at: 29th Dec 2017 04:08
The game wizard works fine. It's the others I've had issues with. I operate my own versions of DarkBasic Pro and Dark GDK. I think Dark GDK is rather powerful as-is. Any application that runs under windows, uses the windows api. It does not matter what programming language you use or what game engine used. If it runs on windows it utilizes the windows api. DarkBasic and Dark GDK is basically a wrapper for the windows and directx api.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 7th Jan 2018 22:57
I agree, DarkGDK does have a decent amount of power and potential. It simplified the mess that Windows API has become. You've seen it. Its just a cluster fuck and ten million commands need to be typed to accomplish the simplest of task. Opening a window and drawing a single pixel to the screen using User32 and WinGDI is minimum 50-100 lines of code or more. Thats nuts and totally uncalled for. They should have shot for simplicity as well as power but instead they don't have any basic commands to do generic stuff. I just made myself a wrapper for WinGDI and SDL so no matter what Lib I am using I can call the same commands to make a window and perform basic functions like writting text to it or setting pixels, line drawing etc, all the basic stuff uncomplicated. I just call

WINDOW mainwindow(x,y,height,width, "Title");
SET_MAINWINDOW(&mainwindow);

and from that point on all my graphic, messaging and handling functions etc are focused on the main window regardless of if I use SDL or WinGDI.... I plan on extending this in the future to use other libs like OpenGL and more DirectX. Now I have a simple Module that I can just link to any program I want and setup and run as simple as that.

I already knew C++ since I was a young kid but was getting frustrated and having issues then one day out of the blue it all sort of clicked and since then I have been writing fluently in C++ again. Still some hiccups but nothing like the endless stream of linker and compiler errors I was receiving.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Hotline
9
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 8th Jan 2018 11:46
Quote: " Its just a cluster fuck and ten million commands need to be typed to accomplish the simplest of task."

That's how ultra low level operating system APIs work.Simplified functions like MakeWindow(x,y) will most likely bite you in the ass sooner or later as at some point will tie your hands and force you to either re-design everything or write patches after patches.The ugly C-ish interface guarantees to have acceess to everything everywhere easily.

Quote: "drawing a single pixel to the screen using User32 and WinGDI is minimum 50-100 lines of code or more"

That's true but that's not how today GPUs are optimized.They require to send large amount of data to them and then the GPU draws it.They were designed to accept as much data they can in one draw call.Drawing everything pixel by pixel is absolutely against the logic of modern hardwares.It completely disables the GPU and forces the CPU to draw everything.
[href=forum.thegamecreators.com/?m=forum_view&t=191567&b=5]Spark Particle engine[/href]
[href=forum.thegamecreators.com/?m=forum_view&t=199163&b=5]Transform gizmo plugin[/href]
Morcilla
15
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 16th Jan 2018 13:43 Edited at: 17th Jan 2018 09:50
@Sedit, and anyone concerned, please visit this thread:

Dark GDK / Who is still using GDK?

Rick Vanner is asking for people still using DGDK, with the intention of closing DGDK forum, if there is not enough people willing to keep it open.

Please make a post in that thread if you want DGDK forum to remain opened.

Also, I suggest to open threads like this current one in that forum [Edit: Oh well, I must correct myself. Since this thread is about a DBPro project migration, it is right placed here.]

Other than that, if I can help with that DGDK migration just let me know.
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 19th Jan 2018 22:02
I have a decent amount of experience in C++ and somewhere along the line if finally just clicked in my head so I am not having hardly any issues with it anymore and can sit and write almost anything I wish.

RTCW, Sure those commands would bit in the ass but its not like the HAVE to be used. If you abstract away something it does not mean the underlying functionality is gone.

As far as the pixel by pixel drawing. Drawing directly to the texture has shown itself to be more then effective. I am getting better FPS currently doing direct memory writing to a texture then I am currently getting attempting to use SDL render copy commands to past sprites. I would be better off to draw each sprite myself instead of allowing SDL to do it for me which is something I am considering doing very soon. First I need to look into some other SDL commands to see if it is worth me doing but if I can not improve performance then I will make my own abstraction.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);

Login to post a reply

Server time is: 2018-02-18 05:18:15
Your offset time is: 2018-02-18 05:18:15