Added Model and default shader; Organization
This commit is contained in:
parent
1c638bdcb9
commit
d74f808a17
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
.vs/
|
||||
bin/
|
||||
int/
|
||||
*aps
|
||||
*aps
|
||||
*res
|
@ -105,6 +105,8 @@
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)dep\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>nf.res;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -126,6 +128,8 @@
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)dep\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>nf.res;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@ -143,6 +147,8 @@
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)dep\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>nf.res;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@ -164,6 +170,8 @@
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)dep\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>nf.res;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,11 +1,9 @@
|
||||
#include "NothinFancy.h"
|
||||
#include "MainState.h"
|
||||
|
||||
using namespace nf;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
Config conf = { 1280, 720, false, "Example Game"};
|
||||
Application app(conf);
|
||||
nf::Config conf = { 1280, 720, false, "Example Game"};
|
||||
nf::Application app(conf);
|
||||
//app.setWindowIcon(...);
|
||||
// app.setWindowCursor(...);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "MainState.h"
|
||||
|
||||
MainState::MainState(Application* app) :
|
||||
MainState::MainState(nf::Application* app) :
|
||||
Gamestate(app)
|
||||
{
|
||||
}
|
||||
@ -13,7 +13,7 @@ void MainState::update(double deltaTime) {
|
||||
}
|
||||
|
||||
void MainState::render() {
|
||||
static Renderer& renderer = *m_app->getRenderer();
|
||||
static nf::Renderer& renderer = *m_app->getRenderer();
|
||||
}
|
||||
|
||||
void MainState::onExit() {
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
class MainState : public nf::Gamestate {
|
||||
public:
|
||||
MainState(Application* app);
|
||||
MainState(nf::Application* app);
|
||||
|
||||
void onEnter() override;
|
||||
|
||||
|
71
NothinFancy/NothinFancy.rc
Normal file
71
NothinFancy/NothinFancy.rc
Normal file
@ -0,0 +1,71 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "src/include/resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United States) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"src/include/resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SHADER
|
||||
//
|
||||
|
||||
IDR_DEFAULTVERTEX RCDATA "res\\defaultShader\\vertex.shader"
|
||||
|
||||
IDR_DEFAULTFRAGMENT RCDATA "res\\defaultShader\\fragment.shader"
|
||||
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -112,6 +112,10 @@
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(IntDir)$(ProjectName).res" "$(SolutionDir)Game\dep\nf.res"</Command>
|
||||
<Message>Copying default NF resources</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
@ -139,6 +143,10 @@
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(IntDir)$(ProjectName).res" "$(SolutionDir)Game\dep\nf.res"</Command>
|
||||
<Message>Copying default NF resources</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
@ -162,6 +170,10 @@
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(IntDir)$(ProjectName).res" "$(SolutionDir)Game\dep\nf.res"</Command>
|
||||
<Message>Copying default NF resources</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
@ -189,12 +201,17 @@
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(IntDir)$(ProjectName).res" "$(SolutionDir)Game\dep\nf.res"</Command>
|
||||
<Message>Copying default NF resources</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\Application.cpp" />
|
||||
<ClCompile Include="src\Gamestate.cpp" />
|
||||
<ClCompile Include="src\IntroGamestate.cpp" />
|
||||
<ClCompile Include="src\Renderer\Drawable.cpp" />
|
||||
<ClCompile Include="src\Renderer\Drawable\Drawable.cpp" />
|
||||
<ClCompile Include="src\Renderer\Drawable\Model.cpp" />
|
||||
<ClCompile Include="src\Renderer\IndexBuffer.cpp" />
|
||||
<ClCompile Include="src\Renderer\Renderer.cpp" />
|
||||
<ClCompile Include="src\Renderer\Shader.cpp" />
|
||||
@ -203,6 +220,7 @@
|
||||
<ClCompile Include="src\Utility.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\include\resource.h" />
|
||||
<ClInclude Include="src\include\Application.h" />
|
||||
<ClInclude Include="src\include\Config.h" />
|
||||
<ClInclude Include="src\include\Drawable.h" />
|
||||
@ -210,6 +228,7 @@
|
||||
<ClInclude Include="src\include\IndexBuffer.h" />
|
||||
<ClInclude Include="src\include\IntroGamestate.h" />
|
||||
<ClInclude Include="src\include\Input.h" />
|
||||
<ClInclude Include="src\include\Model.h" />
|
||||
<ClInclude Include="src\include\NothinFancy.h" />
|
||||
<ClInclude Include="src\include\Renderer.h" />
|
||||
<ClInclude Include="src\include\Shader.h" />
|
||||
@ -220,6 +239,13 @@
|
||||
<ItemGroup>
|
||||
<Natvis Include="NatvisFile.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\defaultShader\fragment.shader" />
|
||||
<None Include="res\defaultShader\vertex.shader" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="NothinFancy.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
@ -39,12 +39,15 @@
|
||||
<ClCompile Include="src\Renderer\Shader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Renderer\Drawable.cpp">
|
||||
<ClCompile Include="src\Renderer\Drawable\Drawable.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Gamestate.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Renderer\Drawable\Model.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\include\Config.h">
|
||||
@ -86,8 +89,23 @@
|
||||
<ClInclude Include="src\include\Drawable.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\include\Model.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\include\resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="NatvisFile.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\defaultShader\vertex.shader" />
|
||||
<None Include="res\defaultShader\fragment.shader" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="NothinFancy.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,31 +0,0 @@
|
||||
#include "Drawable.h"
|
||||
|
||||
namespace nf {
|
||||
Drawable::Drawable(const char* vertexShader, const char* fragmentShader, const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount) :
|
||||
m_shader(vertexShader, fragmentShader),
|
||||
m_vao(),
|
||||
m_ib(indexBufferData, indexBufferCount)
|
||||
{
|
||||
m_vao.addBuffer(vertexBufferData, vertexBufferSize);
|
||||
m_vao.push<float>(2);
|
||||
m_vao.finishBufferLayout();
|
||||
}
|
||||
|
||||
unsigned int Drawable::getIndexCount() {
|
||||
return m_ib.getCount();
|
||||
}
|
||||
|
||||
void Drawable::bind() {
|
||||
m_shader.bind();
|
||||
m_vao.bind();
|
||||
m_ib.bind();
|
||||
}
|
||||
|
||||
Drawable::DrawableType Drawable::identity() {
|
||||
return DrawableType::NF_NONE;
|
||||
}
|
||||
|
||||
Drawable::~Drawable() {
|
||||
|
||||
}
|
||||
}
|
27
NothinFancy/src/Renderer/Drawable/Drawable.cpp
Normal file
27
NothinFancy/src/Renderer/Drawable/Drawable.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include "Drawable.h"
|
||||
|
||||
#include "Utility.h"
|
||||
|
||||
namespace nf {
|
||||
Drawable::Drawable() {
|
||||
Log("Drawable constructor");
|
||||
}
|
||||
|
||||
Drawable::DrawableType Drawable::identity() {
|
||||
return DrawableType::NF_NONE;
|
||||
}
|
||||
|
||||
void Drawable::bind() {
|
||||
Error("Tried to bind an invalid object!");
|
||||
}
|
||||
|
||||
unsigned int Drawable::getIndexCount() {
|
||||
return m_ib->getCount();
|
||||
}
|
||||
|
||||
Drawable::~Drawable() {
|
||||
delete m_vao;
|
||||
delete m_ib;
|
||||
delete m_shader;
|
||||
}
|
||||
}
|
44
NothinFancy/src/Renderer/Drawable/Model.cpp
Normal file
44
NothinFancy/src/Renderer/Drawable/Model.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
#include "Model.h"
|
||||
|
||||
#include "Utility.h"
|
||||
|
||||
namespace nf {
|
||||
Model::Model() {
|
||||
}
|
||||
|
||||
void Model::create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount, const char* vertexShader, const char* fragmentShader) {
|
||||
m_vao = new VertexArray;
|
||||
m_vao->addBuffer(vertexBufferData, vertexBufferSize);
|
||||
m_vao->push<float>(2);
|
||||
//TODO: Change this to 3
|
||||
m_vao->finishBufferLayout();
|
||||
m_ib = new IndexBuffer(indexBufferData, indexBufferCount);
|
||||
if (vertexShader && fragmentShader)
|
||||
m_shader = new Shader(vertexShader, fragmentShader);
|
||||
}
|
||||
|
||||
Drawable::DrawableType Model::identity() {
|
||||
return DrawableType::NF_GAME;
|
||||
}
|
||||
|
||||
void Model::bind() {
|
||||
if (m_vao == nullptr)
|
||||
Error("Tried to bind uninitialized model!");
|
||||
m_vao->bind();
|
||||
m_ib->bind();
|
||||
if (m_shader) {
|
||||
m_shader->bind();
|
||||
//TODO: Set uniforms here such as position and texture
|
||||
}
|
||||
}
|
||||
|
||||
bool Model::hasCustomShader() {
|
||||
if (m_shader)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Model::~Model() {
|
||||
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "Application.h"
|
||||
#include "Utility.h"
|
||||
#include "resource.h"
|
||||
|
||||
namespace nf {
|
||||
Renderer::Renderer(Application* app) {
|
||||
@ -51,15 +52,21 @@ namespace nf {
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
Win32Res vs(IDR_DEFAULTVERTEX);
|
||||
m_defaultVertex = (const char*)vs.ptr;
|
||||
Win32Res fs(IDR_DEFAULTFRAGMENT);
|
||||
m_defaultFragment = (const char*)fs.ptr;
|
||||
m_defaultShader = new Shader(m_defaultVertex, m_defaultFragment);
|
||||
}
|
||||
|
||||
void Renderer::render(Drawable* in) {
|
||||
if (in == nullptr)
|
||||
void Renderer::render(Drawable& in) {
|
||||
if (&in == nullptr)
|
||||
Error("Drawable object tried to render before being constructed!");
|
||||
if (in->identity() == Drawable::DrawableType::NF_UI)
|
||||
m_lUI.push_back(in);
|
||||
if (in.identity() == Drawable::DrawableType::NF_UI)
|
||||
m_lUI.push_back(&in);
|
||||
else
|
||||
m_lGame.push_back(in);
|
||||
m_lGame.push_back(&in);
|
||||
}
|
||||
|
||||
void Renderer::doFrame() {
|
||||
@ -67,8 +74,10 @@ namespace nf {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
for (Drawable* draw : m_lGame) {
|
||||
Drawable& curr = *draw;
|
||||
Model& curr = (Model&)*draw;
|
||||
curr.bind();
|
||||
if (!curr.hasCustomShader())
|
||||
m_defaultShader->bind();
|
||||
glDrawElements(GL_TRIANGLES, curr.getIndexCount(), GL_UNSIGNED_INT, nullptr);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace nf {
|
||||
m_lastStride = 0;
|
||||
}
|
||||
|
||||
void VertexArray::bind(unsigned int buffer) {
|
||||
void VertexArray::bind() {
|
||||
if (m_buffers.empty())
|
||||
Error("No buffers and layouts added to vertex array before being bound!");
|
||||
if (!m_lastBufferHasLayout)
|
||||
|
@ -54,6 +54,20 @@ namespace nf {
|
||||
}
|
||||
#endif
|
||||
|
||||
Win32Res::Win32Res(int id) :
|
||||
ptr(nullptr),
|
||||
size(0)
|
||||
{
|
||||
HRSRC src = FindResource(NULL, MAKEINTRESOURCE(id), RT_RCDATA);
|
||||
if (src) {
|
||||
HGLOBAL temp = LoadResource(NULL, src);
|
||||
if (temp) {
|
||||
ptr = LockResource(temp);
|
||||
size = (size_t)SizeofResource(NULL, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wchar_t* toWide(const char* in) {
|
||||
int length = std::strlen(in) + 1;
|
||||
wchar_t* out = new wchar_t[length];
|
||||
|
@ -9,17 +9,17 @@ namespace nf {
|
||||
enum class DrawableType {
|
||||
NF_NONE, NF_GAME, NF_UI
|
||||
};
|
||||
Drawable(const char* vertexShader, const char* fragmentShader, const void* vertexBuffer, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount);
|
||||
//TODO: Construct using Shader code and data from obj
|
||||
Drawable();
|
||||
|
||||
unsigned int getIndexCount();
|
||||
void bind();
|
||||
virtual DrawableType identity();
|
||||
virtual void bind();
|
||||
unsigned int getIndexCount();
|
||||
|
||||
~Drawable();
|
||||
protected:
|
||||
//TODO: Add VAO, Shader, index buffer, etc.
|
||||
Shader m_shader;
|
||||
VertexArray m_vao;
|
||||
IndexBuffer m_ib;
|
||||
VertexArray* m_vao;
|
||||
IndexBuffer* m_ib;
|
||||
Shader* m_shader;
|
||||
};
|
||||
}
|
18
NothinFancy/src/include/Model.h
Normal file
18
NothinFancy/src/include/Model.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "Drawable.h"
|
||||
|
||||
namespace nf {
|
||||
class Model : public Drawable {
|
||||
public:
|
||||
Model();
|
||||
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount, const char* vertexShader = nullptr, const char* fragmentShader = nullptr);
|
||||
DrawableType identity() override;
|
||||
void bind() override;
|
||||
bool hasCustomShader();
|
||||
|
||||
~Model();
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
@ -2,6 +2,4 @@
|
||||
|
||||
#include "Application.h"
|
||||
#include "Input.h"
|
||||
#include "Utility.h"
|
||||
|
||||
using namespace nf;
|
||||
#include "Utility.h"
|
@ -2,7 +2,7 @@
|
||||
#include <vector>
|
||||
#include <Windows.h>
|
||||
|
||||
#include "Drawable.h"
|
||||
#include "Model.h"
|
||||
|
||||
namespace nf {
|
||||
class Application;
|
||||
@ -11,7 +11,7 @@ namespace nf {
|
||||
public:
|
||||
Renderer(Application* app);
|
||||
|
||||
void render(Drawable* in);
|
||||
void render(Drawable& in);
|
||||
|
||||
void doFrame();
|
||||
|
||||
@ -24,5 +24,8 @@ namespace nf {
|
||||
|
||||
std::vector<Drawable*> m_lGame;
|
||||
std::vector<Drawable*> m_lUI;
|
||||
const char* m_defaultVertex;
|
||||
const char* m_defaultFragment;
|
||||
Shader* m_defaultShader;
|
||||
};
|
||||
}
|
@ -15,6 +15,5 @@ namespace nf {
|
||||
private:
|
||||
unsigned int m_id;
|
||||
std::unordered_map<const char*, unsigned int> m_uniformLocations;
|
||||
//TODO: Load from resource
|
||||
};
|
||||
}
|
@ -38,8 +38,15 @@ __debugbreak();}
|
||||
std::exit(-1);}
|
||||
#endif
|
||||
|
||||
struct Win32Res {
|
||||
Win32Res(int id);
|
||||
void* ptr;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
const wchar_t* toWide(const char* in);
|
||||
const wchar_t* toWide(const std::string& in);
|
||||
bool writeFile(const char* filename, const std::string& in);
|
||||
std::string readFile(const char* filename);
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ namespace nf {
|
||||
template<typename T>
|
||||
void push(unsigned int count);
|
||||
void finishBufferLayout();
|
||||
void bind(unsigned int buffer = 1);
|
||||
void bind();
|
||||
|
||||
~VertexArray();
|
||||
private:
|
||||
|
17
NothinFancy/src/include/resource.h
Normal file
17
NothinFancy/src/include/resource.h
Normal file
@ -0,0 +1,17 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by NothinFancy.rc
|
||||
//
|
||||
#define IDR_DEFAULTVERTEX 201
|
||||
#define IDR_DEFAULTFRAGMENT 202
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
@ -16,14 +16,16 @@ Remember to use tasks (//TODO: )
|
||||
*Separate project
|
||||
*Namespaced
|
||||
Refactor NothinFancy.h to ONLY include stuff the frontend needs
|
||||
AND get rid of NFENGINE
|
||||
High CPU usage?
|
||||
*AND get rid of NFENGINE
|
||||
*High CPU usage?
|
||||
*Debug and log system
|
||||
*NatVis
|
||||
*Config changing
|
||||
*Alt-Enter
|
||||
*File IO functions
|
||||
*Keyboard and mouse click input
|
||||
Separate Model and UIElement from Drawable
|
||||
Entity and Camera classes
|
||||
Mouse position input
|
||||
Audio
|
||||
*Game states
|
||||
|
Reference in New Issue
Block a user