hschumann2/TempleOS-Source-Code
0847
1 2#define GRID 53 4U0 DrawMyMs(CDC *dc,I64 x,I64 y)5{6 dc->thick=1;7 dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);8 GrRect(dc,x,y,GRID,GRID);9}10 11U0 GridDemo()12{13 CGridGlbls old_grid;14 U0 (*old_draw_ms)(CDC *dc,I64 x,I64 y); //Can't init this type of var.15 MemCpy(&old_grid,&ms_grid,sizeof(CGridGlbls));16 GridInit;17 ms_grid.snap=TRUE; //You can set other stuff.18 ms_grid.x=GRID;19 ms_grid.y=GRID;20 old_draw_ms=gr.fp_draw_ms;21 gr.fp_draw_ms=&DrawMyMs;22 while (!ms.lb) {//Left bttn to exit.23 GrPlot(,ms.pos.x,ms.pos.y);24 Yield;25 }26 DCFill;27 gr.fp_draw_ms=old_draw_ms;28 MemCpy(&ms_grid,&old_grid,sizeof(CGridGlbls));29}30 31GridDemo;32 