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 / Where Post Legit Bugs DarkGDK? dbMakeImageFromMemblock(imgid,memid)

Author
Message
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Sep 2007 02:55
Anyone know? (The DarkBasic Pro Bug Forum? Here Somewhere? Submit via the Contact Us Thing?)

Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Sep 2007 03:37
Sorry for Double Post but I looked online for a good free PNG gfx splitter - no dice yet - I forced the VS2005 Express "to Continue" over the uninitialized variable error - and it goes through - (Had to do it like 32 times for my test animation which stinks) - So this might not be a DOA bug as much as a MAJOR inconvienance because SHUTTING off these kinds of debugging features to get DarkGDK to run - means I lose that sort of "safety checking" for my own code in development - which double stinks.

That's the update... going back for round 3

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Sep 2007 04:01
I don't believe it works - has anyone had good results with this DarkGDK function?

The code I'm using is based on "Steve's Famous Image Splitter" - but that isn't enough to confirm or deny etc... so if anyone has seen this function work - that will be enough for me...

Thanx in advance.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Sep 2007 19:30
I've never seen that error message before - I'm assuming that it's a VC++2005 specific check to ensure that variables are properly initialised before use - If that's the case, then I'm not sure that there's anything you can do about it.

Grasping at straws here: Maybe, if you can determine the variables type, you can declare it 'extern' in your code, and give it a default value.

As an alternative, you may want to consider forgetting about memblocks for image manipulation - they just aren't needed. Instead, you can use get dbGetImagePointer & dbMakeImage* functions to get pointers to the DX COM objects, lock their surfaces, and then read/write pixels that way. You may even be able to do your copying using blits.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Sep 2007 20:42
@IanM - Very Very Interesting.

(Of course this means more digging )

I'll scope out those options. Ultimately I just need a decent:

1: load an image
2: Define a grid
3: Chop it up into tiny images in memory

USES: animations, graphical 2-d fonts, sprite'ing, and other thingy-ma-jigs (widgets haha)


Seriously - IanM - You're presenting techniques I know from a Win32 API point of view - that I have no idea how to do with DarkGDK and DX yet - but I get what you're saying - basically...

I can Snag the ACTUAL (or dereferenced pointer to) Direct X objects and rip how I want - and it SOUNDS like you are eluding to BLITS because (guessing) its a very fast way to move data between vid-to-vid vid-to ram for gfx?!?!?

REgardless if I'm right or wrong - I bet you are right - so I'll dig - Thank you very much as always!
Jason

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 18th Sep 2007 11:14
Hey, don't know was going on, but I've used that command (dbMakeImageFromMemblock) with success before, if that helps.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Sep 2007 13:22
@Morcilla - THAT does help! That means more than likely I did something wrong. wouldn't be the first time! Thank you for your input. That suggests I should have another go at figuring out that routine!

(Side Note: Trying to get Image Splitter Routine Working - Steve's (BatVink) Famous Image Splitter worked so well - I ported it... evidently - WRONG But I'll scope it out again due to your comment - and I'll look at what IanM said and on my own see about the dbGetImage(FromBitmap) think in DarkGDK if I can get that to work (Off screen) that would be a simpler solution that BatVinks ingenious in memblock image slicing.


THANK YOU!

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Sep 2007 15:49
If it's possible to blit between textures, that would definitely be the fastest way.

If you find the DX stuff confusing, or too much at this point, there are some higher level functions available too - they just won't be as fast as direct access. Take a look in the image header file for dbLockImage, dbUnlockImage, dbGetImage (with 3 pointer parameters) and dbWriteImage

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Sep 2007 18:05
I do find the DX stuff to much at this point - What I'll proably do is come up with a DarkGDK way for now - and if speed becomes an issue - where I need that same functionality RIPPING fast - I'll revisit - after I have something resembling a game started.

I'm still staring at text all the time - and I want to see some Graphics

I'm going to come back here though and examine what you posted as I get into it - which will be sooner than later because I'm staring at an empty "SplitImage" function waiting to be filled with some code that does the job

Login to post a reply

Server time is: 2024-11-16 20:44:39
Your offset time is: 2024-11-16 20:44:39