rendering different colors worksgit add .!
This commit is contained in:
@@ -25,3 +25,4 @@ set( CMAKE_CXX_STANDARD 11)
|
||||
set( CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
add_executable(${PROJECT_NAME} input.cpp )
|
||||
target_link_libraries(${PROJECT_NAME} TartLib PickleLib)
|
||||
add_subdirectory(render_test)
|
||||
|
||||
7
testing/render_test/CMakeLists.txt
Normal file
7
testing/render_test/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/tests)
|
||||
project(render_test)
|
||||
|
||||
set( CMAKE_CXX_STANDARD 11)
|
||||
set( CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
add_executable(${PROJECT_NAME} main.cpp )
|
||||
target_link_libraries(${PROJECT_NAME} TartLib)
|
||||
20
testing/render_test/main.cpp
Normal file
20
testing/render_test/main.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <tart.h>
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
struct tart_window window = tart_create_window();
|
||||
struct tart_buffer mainbuff = tart_create_buffer(109, {20,20},{20,20});
|
||||
struct tart_cell cells[20*20];
|
||||
for(int i = 1; i < 20*20; i += 2) {
|
||||
cells[i] = tart_create_cell('^', TART_STYLE_BOLD, TART_COLOR_BLACK_FOREGROUND, TART_COLOR_WHITE_BACKGROUND);
|
||||
}
|
||||
for(int i = 0; i < + 20*20; i += 2) {
|
||||
cells[i] = tart_create_cell('^', TART_STYLE_BOLD, TART_COLOR_WHITE_BACKGROUND, TART_COLOR_BLACK_BACKGROUND);
|
||||
}
|
||||
tart_add_cells_to_buffer(&mainbuff, cells);
|
||||
|
||||
char* t;
|
||||
tart_add_buffer(&window, mainbuff);
|
||||
tart_draw_window(&window, t);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user