Example from my game -- initialization with Cloggy's D3D d3dInit()
//Initialization
dbSetWindowLayout(0,0,0);
dbSetDisplayModeAntialias (screenWidth,screenHeight,dbScreenDepth(),1,0,0);
dbMaximiseWindow();
dbAutoCamOff(); //если не сделать, то после создания каждого объекта камера будет лететь к нему
dbBackdropOn(); dbColorBackdrop(dbRgb(0,0,0));
dbSetCameraRange (0.5f, 60000.0f);
dbSetCameraFOV(0,31.0f); //FOV=31.0f в этой игре, изначально в DarkGDK был 61.9621391296f.
dbPositionCamera (0.0001f, 9.0f, 0.0f);
dbPointCamera (0.0f, 0.0f, 0.0f);
dbSync();
//Fonts (smoothed !!!)
dbSetDir ("data/");
AddFontResourceExA("font/Olietta script.ttf",FR_PRIVATE,0); //font in "data/font/" folder
d3dInit(3); //Cloggy's D3D initialisation after changing the screen resolution. Cloggy recommends not more then 20 fonts.
d3dFont(1,"Verdana",17,0,0,0); //font from Windows
d3dFont(2,"Olietta script",52,0,0,0); //font from public domain
d3dFont(3,"Verdana",21,0,0,0); //font from Windows
//DarkGDK's font (not smoothed)
dbSetTextFont ("Verdana");
dbSetTextSize (18);
//Colors
d3dDrawColor (188, 188, 188, 255);
dbInk (dbRgb(188,188,188), 0);
Examples of using Cloggy's D3D
void ShowMyStatistics (void)
{
int n=0; char timeString1[100];
DWORD cloggyDwordColor1 = d3dRGBA(0,161,255,255);
d3dStartText();///////////////////
n++; sprintf (timeString1, "dbScreenFPS()= %d", dbScreenFPS()); d3dText(1,0,20*n,0,timeString1,cloggyDwordColor1);
n++; sprintf (timeString1, "Mouse X,Y = %d, %d", dbMouseX(), dbMouseY()); d3dText(1,0,20*n,0,timeString1,cloggyDwordColor1);
n++; sprintf (timeString1, "Polygons count = %d", dbStatistic(1)); d3dText(1,0,20*n,0,timeString1,cloggyDwordColor1);
n++; sprintf (timeString1, "FOV=%.1f",FOV); d3dText(1,0,20*n,0,timeString1,cloggyDwordColor1);
//current screen resolution (not original screen resolution). Or use dbDesktopWidth(), dbDesktopHeight();
n++; sprintf (timeString1, "Screen = %dx%d", GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); d3dText(1,0,20*n,0,timeString1,cloggyDwordColor1);
d3dEndText();//////////////////
}
void Example_0002 (void)
{
d3dBox(300,300,400,1300);
d3dLine3D(100,100,100,200,200,200);
//If you have many dots or lines -- use batch.
d3dStartText();
d3dBoxText(1,300,300,100,1000,1,0,"dgsdg segasd fsds ta fh srdt jdgjdg dgsdg segasd fsds ta fh srdt jdgjdg", d3dRGBA(200,0,0,255));
d3dEndText();
}