Skip to content

Commit

Permalink
Update example code based on feedback in #79
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlohr committed Oct 3, 2024
1 parent 51b7ca2 commit 565787e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rawdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ unsigned long iframeno = 0;

void HandleKey( int keycode, int bDown )
{
if( keycode == 27 ) exit( 0 );
printf( "Key: %d -> %d\n", keycode, bDown );
printf( "Scancode: %d -> %d\n", CNFGLastScancode, bDown );
printf( "Char: %c\n", CNFGLastCharacter );
if( keycode == 27 || keycode == CNFG_KEY_ESCAPE ) exit( 0 );
}

void HandleButton( int x, int y, int button, int bDown )
Expand All @@ -34,6 +34,13 @@ void HandleMotion( int x, int y, int mask )
// printf( "Motion: %d,%d (%d)\n", x, y, mask );
}

int HandleDestroy()
{
printf( "Destroying\n" );
exit(10);
return 0;
}

#define HMX 40
#define HMY 40
short screenx, screeny;
Expand Down Expand Up @@ -155,13 +162,6 @@ void DrawHeightmap()
}


int HandleDestroy()
{
printf( "Destroying\n" );
exit(10);
return 0;
}

uint32_t randomtexturedata[65536];

int main()
Expand Down

0 comments on commit 565787e

Please sign in to comment.