#include "resource1.h"
#include <d3dx9.h>
#include <d3d9.h>
#include <DarkGDK.h>
int i=0;
float step = 3;
float sx = 0;
int speed = 4;
int waves = 10;
int width=640;
int height=480;
void DarkGDK ( )
{
dbHideMouse();
dbSetDisplayMode(width,height,32);
dbSetWindowOff();
dbSyncOn ( );
dbSyncRate ( 60 );
LPD3DXSPRITE ppSprite=NULL;
LPDIRECT3DTEXTURE9 pTexture=NULL;
LPDIRECT3DDEVICE9 pDevice=dbGetDirect3DDevice();
D3DXCreateTextureFromResource(pDevice,NULL,MAKEINTRESOURCE(IDB_BITMAP1),&pTexture);
//you could also use dbMakeImage() to put it into image slot
//when i tried it didn`t work so i made a dx sprite and then used
//getimage but that streched it slightly.
D3DXCreateSprite(pDevice,&ppSprite );
D3DXVECTOR3 pos;
pos.x=0.0f;
pos.y=0.0f;
pos.z=0.0f;
ppSprite->Begin(D3DXSPRITE_ALPHABLEND|D3DXSPRITE_SORT_TEXTURE);
ppSprite->Draw(pTexture,NULL,NULL,&pos,0xFFFFFFFF);
ppSprite->End();
for ( i = 1; i <= height; i++ ) {
dbGetImage( i, 0, i - 1, width, i );
}
dbCLS();
while ( LoopGDK ( ) )
{
for ( i = 1; i <= height; i++ ) {
dbPasteImage( i, 0, i + dbSin( sx + i * step ) * waves );
}
sx += speed;
if (dbMouseMoveX() || dbMouseMoveY()||dbScanCode() || dbMouseMoveZ() == 1 )
{
dbSleep( 500 );
return;
}
dbSync ( );
}
return;
}
nvidia geforce 8600gt + amd athlon 64
windows xp pro.