fastdraw64 is a graphic engine software rendering running on 64 bits windows platform written in C and assembly language
// fastdraw64 tuto1 create window
#include "fastdraw.cpp"
void draw() {
fd_clear(0,0,100); // clear the buffer
}
int main() {
fd_window("fd64 tuto1",800,600);
fd_loop(draw);
return 0;
}
Fast Clear 64bits
void fd_clear(byte r,byte g,byte b) {
static byte red asm("red") = r;
static byte green asm("green") = g;
static byte blue asm("blue") = b;
asm ("mov rax,red\n"
"shl rax,8\n"
"or rax,green\n"
"shl rax,8\n"
"or rax,blue\n"
"mov rbx,rax\n"
"shl rax,32\n"
"or rax,rbx\n"
"mov rdi,fd_backbuffer\n"
"mov rcx,size\n"
"shr rcx,3\n"
"cld\n"
"rep stosq");
}
Aucun commentaire:
Enregistrer un commentaire
Remarque : Seul un membre de ce blog est autorisé à enregistrer un commentaire.