Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Mac",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceFolder}/vcpkg/installed/x64-osx/include"
],
"macFrameworkPath": [
"/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cppStandard": "c++17"
}
],
"version": 4
}
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/gleam.app/Contents/MacOS/gleam",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}/out/gleam.app/Contents/MacOS",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
}
]
}
29 changes: 29 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"group": "build",
"windows": {
"command": ".\\Build.ps1"
},
"osx": {
"command": "./build.sh"
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Start",
"type": "shell",
"osx":{
"command": "./gleam",
"options" :{
"cwd": "out/gleam.app/Contents/MacOS"
}
}
}
]
}
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ if(NOT CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()

enable_testing()

add_executable(
TextLibraryTests
Test/Renderer/Text/ImmutableBTreeTests.cpp)
target_link_libraries(TextLibraryTests PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main)

add_test(TextLibraryTests TextLibrary)



#========== Targets Configurations ============#

# Build an executable (Unix-like OSes generates ./gleam, on
Expand All @@ -32,6 +43,7 @@ find_package(Freetype REQUIRED)
find_package(glad CONFIG REQUIRED)
find_package(GLEW REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)

# Build RenderFramework.. abstraction for the renderer.
add_library(
Expand All @@ -57,6 +69,7 @@ target_link_libraries(OpenGLRenderer PRIVATE Freetype::Freetype)
# Build Text library.. library for opening and interacting with text and files.
add_library(
TextLibrary
Renderer/Text/ImmutableBTree.cpp
Renderer/Text/TextDocument.cpp)

# Build Text box library.. library for displaying files.
Expand Down
2 changes: 2 additions & 0 deletions Init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ Push-Location .\vcpkg
.\vcpkg.exe install glfw3 --triplet x64-windows
.\vcpkg.exe install freetype-gl --triplet x86-windows
.\vcpkg.exe install freetype-gl --triplet x64-windows
.\vcpkg.exe install gtest --triplet x86-windows
.\vcpkg.exe install gtest --triplet x64-windows
Pop-Location
6 changes: 6 additions & 0 deletions Renderer/Text/AbstractLogger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

class AbstractLogger
{

};
1 change: 1 addition & 0 deletions Renderer/Text/ImmutableBTree.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "ImmutableBTree.h"
13 changes: 13 additions & 0 deletions Renderer/Text/ImmutableBTree.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include "ImmutableBTreeNode.h"

template <typename TValue>
class ImmutableBTree : ImmutableBTreeNode<TValue>
{
public:
ImmutableBTree() : ImmutableBTreeNode<TValue>() { }

private:

};
14 changes: 14 additions & 0 deletions Renderer/Text/ImmutableBTreeNode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <vector>

template <typename TValue>
class ImmutableBTreeNode
{
public:
ImmutableBTreeNode() { }

private:
std::vector<ImmutableBTreeNode> branches;
std::vector<TValue> leaves;
};
12 changes: 12 additions & 0 deletions Renderer/Text/Span.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include <assert.h>

class Span
{
public:
Span(unsigned int start, unsigned int length) : Start(start), Length(length) { }

unsigned int Start;
unsigned int Length;
};
7 changes: 7 additions & 0 deletions Test/Renderer/Text/ImmutableBTreeTests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "gtest/gtest.h"

#include "../../../Renderer/Text/ImmutableBTree.h"

TEST(ImmutableBTreeTests, EmptyTree) {
ImmutableBTree<char> immutableBTree;
}
1 change: 1 addition & 0 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ pushd ./vcpkg
./vcpkg install glad --triplet x64-osx
./vcpkg install glfw3 --triplet x64-osx
./vcpkg install freetype-gl --triplet x64-osx
./vcpkg install gtest --triplet x64-osx
popd