dialogging boob

This commit is contained in:
Alec Obradovich 2018-09-13 06:32:47 -05:00
parent d4efb11dd1
commit c880a085ae
4 changed files with 35 additions and 4 deletions

View file

@ -10,7 +10,7 @@ endif()
set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
#if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s USE_SDL=2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s USE_SDL=2 --preload-file ../resources/client")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\"]'")
#endif()
@ -31,7 +31,7 @@ file(GLOB_RECURSE client_src
add_executable(client ${client_src})
target_include_directories(client
PRIVATE ${PROJECT_SOURCE_DIR}/src/common
#PRIVATE ${PROJECT_SOURCE_DIR}/src/common
PRIVATE ${PROJECT_SOURCE_DIR}/src/client
PRIVATE ${PROJECT_SOURCE_DIR}/include/client)
#PRIVATE ${OPENGL_INCLUDE_DIR}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 MiB

After

Width:  |  Height:  |  Size: 768 KiB

Binary file not shown.

View file

@ -3,10 +3,41 @@
#include <emscripten.h>
#include <iostream>
struct {
static struct {
SDL_Window* window;
SDL_GLContext gl_ctx;
} _ctx;
int main(int argc, char** argv) {
void draw();
int main(int argc, char** argv) {
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
std::cout << SDL_GetError() << std::endl;
return -1;
}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
_ctx.window = SDL_CreateWindow(
"SockScape Client",
0, 0,
640, 480,
SDL_WINDOW_OPENGL
);
_ctx.gl_ctx = SDL_GL_CreateContext(_ctx.window);
if(_ctx.gl_ctx == nullptr)
return -1;
if(glewInit() != GLEW_OK)
return -1;
emscripten_set_main_loop(draw, 0, 1);
}
void draw() {
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(.25, .25, .25, 1);
SDL_GL_SwapWindow(_ctx.window);
}