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;
}