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 / Translating command from DBPro tutorial

Author
Message
Aura Art
16
Years of Service
User Offline
Joined: 29th Sep 2008
Location:
Posted: 30th Sep 2008 00:29
I am trying to translate this command from DBPro to D GDK:

copy memory get pixels pointer(), get memblock ptr(1), 1920000;

I am asking mainly about: "copy memory" and how it was implemented in the D GDK.
I was able to find the other two functions:

I think they are
dbGetPixelsPointer( )
&
dbExtGetMemblockPtr (1)

Though I might be wrong about the second one.

What I am trying to do:

Creat a Memblock, feel it with visual data in real time.
Then dump it on the screen so the user can see the graphics.

Please feel welcome to ask any questions.

I really appreciate any help as I am new sort of new to both C++ and Dark GDK.

Here is what I did so far just to test and see if I can get graphics on the screen.. it is not working.


#include "DarkGDK.h"

void DarkGDK ( void )
{
dbSetWindowOff( );
dbSetDisplayModeEx ( 800, 600, 32 );
dbHideMouse( );
dbSyncOn ( );
dbSyncRate ( 60 );

dbDisableEscapeKey ( );

dbRandomize ( dbTimer ( ) );

int i, j, x, y;
signed long int color;
dbMakeMemblock ( 1, 1920000 );
j = 0;
while ( LoopGDK ( ) )
{
j++;
i = 0;
for (y=0; y<600; y++)
{
for (x=0; x<800; x++)
{
if ( ( i >= 0 ) && ( i < 1920000 ) )
{
color = (x * y) + j ;
dbWriteMemblockDWORD (1, i, color);
i++;
}
}
}
if ( dbEscapeKey ( ) )
break;
dbLockPixels( );
dbCopyMemblock ( 1, 0, 0, dbGetPixelsPointer( ), 1920000 );
dbUnLockPixels( );
dbSync ( );
}
return;
}
Aura Art
16
Years of Service
User Offline
Joined: 29th Sep 2008
Location:
Posted: 30th Sep 2008 00:37
oops, I apologize, I accidently posted twice(it is late here)
Please feel welcome to delete either one or merge them.
Thank you.

Login to post a reply

Server time is: 2024-09-30 07:30:43
Your offset time is: 2024-09-30 07:30:43