Mail Archives: djgpp/2000/09/20/21:13:05
I finally solved my DPMI memory error (thanks to Martin!!!), but a new
problem occurred.
I'm trying to draw 3D polygons using allegro functions.
Here's a piece of code; It should draw a shaded triangle but my screen
looks white! Why?
Thank you in advance for your support.
Ivan
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <allegro.h>
#include <stdio.h>
#include <stdlib.h>
BITMAP *texture;
V3D v1 = {30 , 20 , 10 , 0 , 0 , 9 };
V3D v2 = {30 , 40 , 10 , 0 , 0 , 9 };
V3D v3 = {30 , 30 , 80 , 0 , 0 , 9 };
int main()
{
allegro_init();
install_keyboard();
set_gfx_mode(GFX_AUTODETECT,800,600,0,0);
set_palette(desktop_palette);
triangle3d(screen,POLYTYPE_FLAT,texture,&v1,&v2,&v3);
readkey();
}
- Raw text -