-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kirk Shoop
committed
Nov 12, 2016
1 parent
338496b
commit a3b3d0f
Showing
118 changed files
with
50,737 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) | ||
|
||
get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME) | ||
|
||
project(${SAMPLE_PROJECT} LANGUAGES C CXX) | ||
|
||
MESSAGE( STATUS "Location: " ${CMAKE_CURRENT_SOURCE_DIR} ) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
include(${CMAKE_CURRENT_SOURCE_DIR}/shared.cmake) | ||
|
||
find_path(LIBOAUTH_INCLUDE_DIR oauth.h | ||
PATH_SUFFIXES liboauth) | ||
|
||
find_library(LIBOAUTH_LIBRARY NAMES oauth) | ||
|
||
set(LIBOAUTH_LIBRARIES ${LIBOAUTH_LIBRARY}) | ||
set(LIBOAUTH_INCLUDE_DIRS ${LIBOAUTH_INCLUDE_DIR}) | ||
|
||
find_package_handle_standard_args(liboauth DEFAULT_MSG | ||
LIBOAUTH_LIBRARY LIBOAUTH_INCLUDE_DIR) | ||
mark_as_advanced(LIBOAUTH INCLUDE_DIR LIBOAUTH_LIBRARY) | ||
|
||
MESSAGE( STATUS "LIBOAUTH_INCLUDE_DIRS: " ${LIBOAUTH_INCLUDE_DIRS} ) | ||
|
||
find_package(CURL REQUIRED) | ||
MESSAGE( STATUS "CURL_INCLUDE_DIRS: " ${CURL_INCLUDE_DIRS} ) | ||
|
||
find_package(OpenGL REQUIRED) | ||
MESSAGE( STATUS "OPENGL_INCLUDE_DIRS: " ${OPENGL_INCLUDE_DIRS} ) | ||
|
||
find_package(GLEW REQUIRED) | ||
MESSAGE( STATUS "GLEW_INCLUDE_DIRS: " ${GLEW_INCLUDE_DIRS} ) | ||
|
||
find_package(SDL2 REQUIRED) | ||
string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES) | ||
|
||
MESSAGE( STATUS "SDL2_INCLUDE_DIRS: " ${SDL2_INCLUDE_DIRS} ) | ||
|
||
find_path(JSON_INCLUDE_DIR json.hpp) | ||
set(JSON_INCLUDE_DIRS ${JSON_INCLUDE_DIR}) | ||
|
||
MESSAGE( STATUS "JSON_INCLUDE_DIRS: " ${JSON_INCLUDE_DIRS} ) | ||
|
||
find_path(RXCPP_INCLUDE_DIR rxcpp/rx.hpp HINT .) | ||
set(RXCPP_INCLUDE_DIRS ${RXCPP_INCLUDE_DIR}) | ||
|
||
MESSAGE( STATUS "RXCPP_INCLUDE_DIRS: " ${RXCPP_INCLUDE_DIRS} ) | ||
|
||
# define the sources | ||
set(SAMPLE_SOURCES | ||
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/imgui.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/imgui_draw.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/imgui_demo.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/imgui_impl_sdl_gl3.cpp | ||
) | ||
add_executable(${SAMPLE_PROJECT} ${SAMPLE_SOURCES}) | ||
add_executable(rxcpp::examples::${SAMPLE_PROJECT} ALIAS ${SAMPLE_PROJECT}) | ||
target_compile_options(${SAMPLE_PROJECT} PUBLIC ${SHARED_COMPILE_OPTIONS}) | ||
target_compile_features(${SAMPLE_PROJECT} PUBLIC ${SHARED_COMPILE_FEATURES}) | ||
target_include_directories(${SAMPLE_PROJECT} PUBLIC ${RXCPP_INCLUDE_DIRS} ${LIBOAUTH_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${JSON_INCLUDE_DIRS}) | ||
target_link_libraries(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT} ${LIBOAUTH_LIBRARY} ${CURL_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARIES} ${GLEW_LIBRARIES}) | ||
|
||
# configure unit tests via CTest | ||
enable_testing() | ||
set(CTEST_CONFIGURATION_TYPE "${JOB_BUILD_CONFIGURATION}") | ||
|
||
set_target_properties(${SAMPLE_PROJECT} PROPERTIES FOLDER "Examples") | ||
|
||
add_test(NAME RunTests | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" | ||
COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
rxcpp example of live twitter analysis | ||
|
||
This project was inspired by a [talk](https://blog.niallconnaughton.com/2016/10/25/ndc-sydney-talk/) by @nconnaughton - [github](https://github.com/NiallConnaughton/rx-realtime-twitter), [twitter](https://twitter.com/nconnaughton) | ||
|
||
The goal for this app is to show rxcpp usage and explore machine learning on live data. | ||
|
||
This app demonstrates how multi-thread code can be written using rxcpp to hide all the primitives. thread, mutex, etc.. are all hidden. | ||
|
||
CMAKE is used for the build. There are depenedcies on several libraries. (curl, oauth, sdl2, opengl) | ||
|
||
This project has only been built and tested on OS X. | ||
|
||
There are several shortcuts in place - error handling and retry and completion handling have all gotten short-shrift. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//----------------------------------------------------------------------------- | ||
// USER IMPLEMENTATION | ||
// This file contains compile-time options for ImGui. | ||
// Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO(). | ||
//----------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
//---- Define assertion handler. Defaults to calling assert(). | ||
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR) | ||
|
||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows. | ||
//#define IMGUI_API __declspec( dllexport ) | ||
//#define IMGUI_API __declspec( dllimport ) | ||
|
||
//---- Include imgui_user.h at the end of imgui.h | ||
//#define IMGUI_INCLUDE_IMGUI_USER_H | ||
|
||
//---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions) | ||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS | ||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS | ||
|
||
//---- Don't implement help and test window functionality (ShowUserGuide()/ShowStyleEditor()/ShowTestWindow() methods will be empty) | ||
//#define IMGUI_DISABLE_TEST_WINDOWS | ||
|
||
//---- Don't define obsolete functions names | ||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS | ||
|
||
//---- Pack colors to BGRA instead of RGBA (remove need to post process vertex buffer in back ends) | ||
//#define IMGUI_USE_BGRA_PACKED_COLOR | ||
|
||
//---- Implement STB libraries in a namespace to avoid conflicts | ||
//#define IMGUI_STB_NAMESPACE ImGuiStb | ||
|
||
//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4. | ||
/* | ||
#define IM_VEC2_CLASS_EXTRA \ | ||
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ | ||
operator MyVec2() const { return MyVec2(x,y); } | ||
#define IM_VEC4_CLASS_EXTRA \ | ||
ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ | ||
operator MyVec4() const { return MyVec4(x,y,z,w); } | ||
*/ | ||
|
||
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. | ||
//---- e.g. create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers. | ||
/* | ||
namespace ImGui | ||
{ | ||
void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL); | ||
} | ||
*/ | ||
|
Oops, something went wrong.