Skip to content

Commit

Permalink
project: rename Runtime/runtime -> VGL. namespace VSoftRenderer -> VGL
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxzzk115 committed Nov 2, 2023
1 parent 8a2a103 commit dc78ae1
Show file tree
Hide file tree
Showing 55 changed files with 106 additions and 1,848 deletions.
2 changes: 1 addition & 1 deletion Renderer/Application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif()

add_executable(${PROJECT_NAME} main.cpp)
#set(raylib_VERBOSE 1)
target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp VSoftRendererRuntime tinyobjloader)
target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp VGL tinyobjloader)
# Web Configurations
if (${PLATFORM} STREQUAL "Web")
# Tell Emscripten to build an example.html file.
Expand Down
20 changes: 10 additions & 10 deletions Renderer/Application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// Created or modified by Kexuan Zhang on 2023/10/28 15:50.
//

#include "VSoftRenderer/DirectionalLight.h"
#include "VSoftRenderer/FrameBuffer.h"
#include "VSoftRenderer/Matrix4.h"
#include "VSoftRenderer/VGL.h"
#include "VGL/DirectionalLight.h"
#include "VGL/FrameBuffer.h"
#include "VGL/Matrix4.h"
#include "VGL/VGL.h"

#include <raylib-cpp.hpp>

Expand All @@ -16,7 +16,7 @@

#include <iostream>

using namespace VSoftRenderer;
using namespace VGL;

const int ScreenWidth = 800;
const int ScreenHeight = 800;
Expand Down Expand Up @@ -52,7 +52,7 @@ struct GouraudShader : public VGLShaderBase
return glVertex;
}

virtual bool frag(Vector3Float bc, VSoftRenderer::Color& color) override
virtual bool frag(Vector3Float bc, VGL::Color& color) override
{
float intensity = VaryingIntensity * bc;
Vector2Float uv = VaryingUVs[0] * bc.X + VaryingUVs[1] * bc.Y + VaryingUVs[2] * bc.Z;
Expand Down Expand Up @@ -92,12 +92,12 @@ int main()
auto& shapes = reader.GetShapes();
auto& materials = reader.GetMaterials();

std::vector<VSoftRenderer::Mesh> meshes;
std::vector<VGL::Mesh> meshes;

// Loop over shapes
for (size_t s = 0; s < shapes.size(); s++)
{
VSoftRenderer::Mesh mesh = {};
VGL::Mesh mesh = {};
mesh.Vertices.resize(attrib.vertices.size());

// Loop over faces(polygon)
Expand Down Expand Up @@ -173,8 +173,8 @@ int main()

int textureImageWidth = textureImageData.width;
int textureImageHeight = textureImageData.height;
VSoftRenderer::Color* textureColors = (VSoftRenderer::Color*)LoadImageColors(textureImageData);
VSoftRenderer::Texture2D texture(textureImageWidth, textureImageHeight, textureColors);
VGL::Color* textureColors = (VGL::Color*)LoadImageColors(textureImageData);
VGL::Texture2D texture(textureImageWidth, textureImageHeight, textureColors);

DirectionalLight light(Vector3Float(1, 1, 1).Normalized());

Expand Down
2 changes: 1 addition & 1 deletion Renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
add_subdirectory(3rdparty)
add_subdirectory(Runtime)
add_subdirectory(VGL)
add_subdirectory(Application)
40 changes: 0 additions & 40 deletions Renderer/Runtime/include/VSoftRenderer/Color.h

This file was deleted.

23 changes: 0 additions & 23 deletions Renderer/Runtime/include/VSoftRenderer/DirectionalLight.h

This file was deleted.

50 changes: 0 additions & 50 deletions Renderer/Runtime/include/VSoftRenderer/FrameBuffer.h

This file was deleted.

35 changes: 0 additions & 35 deletions Renderer/Runtime/include/VSoftRenderer/Line.h

This file was deleted.

47 changes: 0 additions & 47 deletions Renderer/Runtime/include/VSoftRenderer/Triangle2D.h

This file was deleted.

21 changes: 0 additions & 21 deletions Renderer/Runtime/include/VSoftRenderer/Utils.h

This file was deleted.

86 changes: 0 additions & 86 deletions Renderer/Runtime/include/VSoftRenderer/VGL.h

This file was deleted.

Loading

0 comments on commit dc78ae1

Please sign in to comment.