Update demo to use Memory Reader for images
This commit is contained in:
parent
553b3682fa
commit
8b15aab802
1 changed files with 15 additions and 1 deletions
|
@ -22,12 +22,22 @@
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#define USE_MEMORY_FILE FALSE // Can be true or false for Win32
|
||||||
|
#else
|
||||||
|
#define USE_MEMORY_FILE TRUE // Non-Win32 - use the compiled in image
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_MEMORY_FILE
|
||||||
|
#include "test-pal8.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static gdispImage myImage;
|
static gdispImage myImage;
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t swidth, sheight;
|
coord_t swidth, sheight;
|
||||||
|
|
||||||
halInit(); // Initialise the Hardware
|
halInit(); // Initialize the Hardware
|
||||||
chSysInit(); // Initialize the OS
|
chSysInit(); // Initialize the OS
|
||||||
gdispInit(); // Initialize the display
|
gdispInit(); // Initialize the display
|
||||||
|
|
||||||
|
@ -38,7 +48,11 @@ int main(void) {
|
||||||
sheight = gdispGetHeight();
|
sheight = gdispGetHeight();
|
||||||
|
|
||||||
// Set up IO for our image
|
// Set up IO for our image
|
||||||
|
#if USE_MEMORY_FILE
|
||||||
|
gdispImageSetMemoryReader(&myImage, test_pal8);
|
||||||
|
#else
|
||||||
gdispImageSetSimulFileReader(&myImage, "test-pal8.bmp");
|
gdispImageSetSimulFileReader(&myImage, "test-pal8.bmp");
|
||||||
|
#endif
|
||||||
|
|
||||||
gdispImageOpen(&myImage);
|
gdispImageOpen(&myImage);
|
||||||
gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0);
|
gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue