Compare commits

..

No commits in common. "938e61f01a6b4806f3b17e5e8f04049d00dff270" and "26e3acf9eb550e8985e616282c4b76f9fa640b60" have entirely different histories.

8 changed files with 9 additions and 147 deletions

View File

@ -212,12 +212,6 @@
<AdditionalDependencies>d3d9.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Directx9|Win32'">
<Link>
<AdditionalLibraryDirectories>.\lib\KCNet-TestDll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>KCNet-TestDll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="lib\ImGui\backends\imgui_impl_opengl3.cpp" />
<ClCompile Include="Main.cpp" />
@ -229,10 +223,8 @@
<ClCompile Include="lib\ImGui\imgui_tables.cpp" />
<ClCompile Include="lib\ImGui\imgui_widgets.cpp" />
<ClCompile Include="menus\main_menu.cpp" />
<ClCompile Include="test\constructor_test.cpp" />
<ClCompile Include="test\directx9_test.cpp" />
<ClCompile Include="test\opengl_test.cpp" />
<ClCompile Include="menus\text_menu.cpp" />
<ClCompile Include="util\keystates.cpp" />
<ClCompile Include="util\text_file_functions.cpp" />
<ClCompile Include="util\text_functions.cpp" />
@ -250,10 +242,8 @@
<ClInclude Include="lib\ImGui\imstb_truetype.h" />
<ClInclude Include="menus\main_menu.h" />
<ClInclude Include="menus\pch.h" />
<ClInclude Include="test\constructor_test.h" />
<ClInclude Include="test\directx9_test.h" />
<ClInclude Include="test\opengl_test.h" />
<ClInclude Include="menus\text_menu.h" />
<ClInclude Include="util\keystates.h" />
<ClInclude Include="util\text_file_functions.h" />
<ClInclude Include="util\text_functions.h" />

View File

@ -4,8 +4,8 @@ Size=400,400
Collapsed=1
[Window][Dear ImGui Demo]
Pos=638,72
Size=550,681
Pos=652,43
Size=550,680
[Window][Hello, world!]
Pos=116,183
@ -35,10 +35,6 @@ Size=499,136
IsChild=1
Size=200,100
[Window][KCNet ImGui]
Pos=113,150
Size=505,566
[Table][0x64418101,3]
RefScale=13
Column 0 Width=63
@ -50,65 +46,3 @@ Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0xC9935533,3]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0x47600645,3]
RefScale=13
Column 0 Width=63
Column 1 Width=63
Column 2 Weight=1.0000
[Table][0xDE6957FF,6]
RefScale=13
Column 0 Width=63
Column 1 Width=63
Column 2 Width=-1
Column 3 Weight=1.0000
Column 4 Weight=1.0000
Column 5 Weight=-1.0000
[Table][0x861D378E,3]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0x1F146634,3]
RefScale=13
Column 0 Width=63
Column 1 Width=63
Column 2 Width=63
[Table][0x8DFA6E86,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
[Table][0xFABAAEF7,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
[Table][0xA43C3885,3]
RefScale=13
Column 0 Width=56
Column 1 Width=56
Column 2 Width=56
[Table][0x49F8DCEA,3]
RefScale=13
Column 0 Weight=1.0000
Column 1 Width=84
Column 2 Width=126
[Table][0x82CBB907,3]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0x49D11DC0,3]
RefScale=13
Column 0 Width=86
Column 1 Width=86
Column 2 Width=86

View File

@ -31,13 +31,9 @@ void TextMenu::TextMainMenu() {
if(show_text)
{
// This just spams the console.
//TextFileFunctions::printTextOutput("test.txt");
TextFileFunctions::printTextOutput("test.txt");
//ImGui::Text(TextFileFunctions::printTextOutput("test.txt"));
// This works!!!
// Why? I didn't think this would print multiple lines.
//outputTextFileContents("test.txt");
TextFileFunctions::outputTextFileContents("test.txt");
}

View File

@ -1,9 +0,0 @@
#include "constructor_test.h"
// TODO Attempt to call in the main class or where ever the hell I'm doing this ImGui test.
Car::Car(std::string x, std::string y, int z) {
brand = x;
model = y;
year = z;
}

View File

@ -1,15 +0,0 @@
#pragma once
#include <iostream>
// https://www.w3schools.com/cpp/cpp_constructors.asp
class Car
{
public:
std::string brand;
std::string model;
int year;
Car(std::string x, std::string y, int z); // Constructor declaration
};

View File

@ -162,9 +162,9 @@ void DirectX9Test::directX9Test()
// Create application window
//ImGui_ImplWin32_EnableDpiAwareness();
WNDCLASSEXW wc = { sizeof(wc), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(nullptr), nullptr, nullptr, nullptr, nullptr, L"KCNet ImGui", nullptr };
WNDCLASSEXW wc = { sizeof(wc), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(nullptr), nullptr, nullptr, nullptr, nullptr, L"ImGui Example", nullptr };
::RegisterClassExW(&wc);
HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"KCNet ImGui", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, nullptr, nullptr, wc.hInstance, nullptr);
HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"Dear ImGui DirectX9 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, nullptr, nullptr, wc.hInstance, nullptr);
// Initialize Direct3D
if (!CreateDeviceD3D(hwnd))

View File

@ -3,10 +3,6 @@
#include <fstream>
#include "text_file_functions.h"
// Add in ImGui for output text file to screen.
#include "imgui.h"
#include "imgui_impl_dx9.h"
// Checking if the file exists breaks without this
// https://stackoverflow.com/questions/19321804/this-function-or-variable-may-be-unsafe-visual-studio
#pragma warning(disable : 4996) //_CRT_SECURE_NO_WARNINGS
@ -60,38 +56,12 @@ void TextFileFunctions::readTextFile(std::string file)
#define _TEST
#endif
// This works
// Some code from Google AI:///
void TextFileFunctions::outputTextFileContents(const char* filePath) {
std::ifstream myfile(filePath);
if (myfile.is_open())
{
std::string line;
std::string content;
// Output file contents
while (std::getline(myfile, line))
{
content += line + "\n";
}
// Close the file
myfile.close();
ImGui::Text("\"%s\" File contents: \n%s", filePath, &content);
//ImGui::InputTextMultiline();
}
else
{
ImGui::Text("Error opening file %s", filePath);
}
}
// Add test function for this, I need to figure out how to return an array like this.
#ifdef _TEST
// This prints the text file output to the console but spams it, I probably won't use this much.
void TextFileFunctions::printTextOutput(std::string file)
{
//std::string line;
//std::string line[1000];
std::string line;
std::ifstream myfile(file);
@ -102,8 +72,7 @@ void TextFileFunctions::printTextOutput(std::string file)
{
while (std::getline(myfile, line))
{
// Disabled for now
//std::cout << line << '\n';
std::cout << line << '\n';
//return line;
}

View File

@ -5,7 +5,4 @@ public:
static void readTextFile(std::string file);
//static std::string printTextOutput(std::string file);
static void printTextOutput(std::string file);
static void outputTextFileContents(const char* filePath);
};