mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
snapshot: does something
This commit is contained in:
parent
b62ab69799
commit
947b28f3b3
2 changed files with 51 additions and 0 deletions
9
xwords4/wasm/Makefile
Normal file
9
xwords4/wasm/Makefile
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
INPUTS = main.c
|
||||
|
||||
all: main.html
|
||||
|
||||
main.html: ${INPUTS}
|
||||
emcc -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' $^ -o $@
|
||||
|
||||
|
42
xwords4/wasm/main.c
Normal file
42
xwords4/wasm/main.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Copyright 2011 The Emscripten Authors. All rights reserved.
|
||||
// Emscripten is available under two separate licenses, the MIT license and the
|
||||
// University of Illinois/NCSA Open Source License. Both these licenses can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <emscripten.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
|
||||
SDL_Window* window;
|
||||
SDL_Renderer* renderer;
|
||||
|
||||
SDL_CreateWindowAndRenderer(600, 400, 0, &window, &renderer);
|
||||
|
||||
int result = 0;
|
||||
|
||||
/**
|
||||
* Set up a white background
|
||||
*/
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 50, 50);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
/**
|
||||
* Show what is in the renderer
|
||||
*/
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
printf("you should see an image.\n");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue