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 / Memblocks?

Author
Message
Paynterboi TicTacToe
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location: That one place
Posted: 3rd Oct 2009 04:01
I have surfed the forums for a day or two on and off for info regrading memblocks. I went through the documentation and the header files and got lists of commands and all that. But what are memblocks? Can I get an example of how to use a basic memblock? I;m not sure if i'm going to use one or not I just want to learn and To create a thread containing a mini tutorial so that people can use it as a reference.

Also what are shaders? The concept of them is ver vauge to me, I can assume they have something to do with 3D programming which is still slightly out of my reach but I;ve seen images in which they are used and they intrigue me.

THANKS!

EYE R T3H +ick +ack +oe mester
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Oct 2009 04:16
Memblocks:
They just hold raw data for whatever you want, you could use them to store a list of 'ints' instead of an array.
They seem more confusing at first because you place the data in and access it out by refering to the position of the data in the memblock in bytes (instead of just an index, for arrays)

DWORD - 4 Bytes
Float - 4 Bytes
Int - 4 Bytes

etc...
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 3rd Oct 2009 07:10 Edited at: 3rd Oct 2009 07:14
ok I give you an example lets say you want to add too mem blocks together.
12+(xdist+werethesestarts+ydist*thewidthofthemall)*4= the comination of 2 dif bitmaps into one.
Now let us say that you had n amout of bitmaps that you wanted to put as one bitmap.
then you would have to modify werethesestarts for each mem code and every memcode. and modify thewidthofthemall to the apropriate value. Why would you want to do this well in my case I want to create a font that can be highlighted and not highlighted.

Go through yourself at a wall.
Paynterboi TicTacToe
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location: That one place
Posted: 4th Oct 2009 03:10
What is the syntax for creating a memblock of a bitmap?

If I wanted to lead that same bitmap into my program i.e. loadimage(), how would I do that?

Can they be used for 3d objects as well?

What are the benefits of useing memblocks as opposed to useing arrays as in amtty's example?

What are the benefirst to useing memblocks for bitmaps?

EYE R T3H +ick +ack +oe mester
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 4th Oct 2009 11:16
I don't know why memblocks were included in the GDK version as they are pointless and just add limitations to the existing memory facilities within C++. Nevertheless, you must use them to create certain types of media from raw memory which is why you'd use them. In terms of using them to actually store data normally, you'd never use them in GDK.

I suggest you search the forums for information on memblock images, meshes etc as there's already many topics dedicated to the subject. However, the majority will be based on DBPro, but this shouldn't be an issue as their usage is identical, you just prefix db, camel case the words and remove the spaces, add parentheses and it should work.

3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 4th Oct 2009 19:24 Edited at: 4th Oct 2009 19:33
here is a portain of code that I made using memblocks.
to explain I tell you what each part is. dbmakememblock creates a block of mem 24765 bits i got this through a calculation of (126-27-32)*7*13*4 where did i get 126, 27, and 32 well from the ascii char chart 27 is @-Z. 7 and 13 are higth and width of each char. 126 is telda and so on. The writememblock 1,0,213 and the 1,1,1 define the width of the bitmap which is 213+256. the 1,4,13 defines the higth. If you don't understand this well then I guess that you should not use them.


Go through yourself at a wall.

Login to post a reply

Server time is: 2024-10-01 14:38:32
Your offset time is: 2024-10-01 14:38:32