mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 10:19:59 +01:00
Adding OBJ model support
This commit is contained in:
@@ -162,20 +162,11 @@ add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
|
||||
message(STATUS "Compiling 'TinyFileDialog' from https://github.com/native-toolkit/tinyfiledialogs.git -- ${TINYFD_INCLUDE_DIR}.")
|
||||
|
||||
#
|
||||
# BOXER - NATIVE MESSAGE DIALOG
|
||||
# OBJ LOADER
|
||||
#
|
||||
#add_subdirectory(ext/Boxer)
|
||||
#set(BOXER_INCLUDE_DIR ${Boxer_SOURCE_DIR}/include)
|
||||
#set(BOXER_LIBRARY Boxer)
|
||||
#message(STATUS "Including 'Boxer' from https://github.com/aaronmjacobs/Boxer.git -- ${BOXER_INCLUDE_DIR}.")
|
||||
|
||||
#
|
||||
# NATIVE FILE DIALOG
|
||||
#
|
||||
# add_subdirectory(ext/nfd)
|
||||
# set(NFD_INCLUDE_DIR ${NFD_SOURCE_DIR}/include)
|
||||
# set(NFD_LIBRARY NFD)
|
||||
# message(STATUS "Including 'NativeFileDialog' from http://www.frogtoss.com/labs -- ${NFD_INCLUDE_DIR}.")
|
||||
set(OBJLOADER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/obj)
|
||||
add_library(OBJLOADER "${CMAKE_CURRENT_SOURCE_DIR}/ext/obj/ObjLoader.cpp")
|
||||
message(STATUS "Compiling 'ObjLoader' from https://github.com/mortennobel/OpenGL_3_2_Utils -- ${OBJLOADER_INCLUDE_DIR}.")
|
||||
|
||||
# find_package(PkgConfig REQUIRED)
|
||||
# pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||
@@ -184,11 +175,6 @@ message(STATUS "Compiling 'TinyFileDialog' from https://github.com/native-toolki
|
||||
# Application
|
||||
#
|
||||
|
||||
#
|
||||
# SCENE GRAPH
|
||||
#
|
||||
|
||||
|
||||
# Setup the environment
|
||||
include_directories(
|
||||
${GSTREAMER_INCLUDE_DIR}
|
||||
@@ -249,6 +235,9 @@ set(VMIX_RSC_FILES
|
||||
./rsc/images/busy.png
|
||||
./rsc/images/icons.dds
|
||||
./rsc/images/seed_512.jpg
|
||||
./rsc/images/shadow.jpg
|
||||
./rsc/models/square_border.obj
|
||||
./rsc/models/shadow.mtl
|
||||
)
|
||||
|
||||
add_executable(${VMIX_BINARY}
|
||||
@@ -282,6 +271,7 @@ target_link_libraries(${VMIX_BINARY} LINK_PRIVATE
|
||||
${NFD_LIBRARY}
|
||||
${PNG_LIBRARY}
|
||||
${THREAD_LIBRARY}
|
||||
OBJLOADER
|
||||
TINYXML2
|
||||
TINYFD
|
||||
IMGUI
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "GstToolkit.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __GSTGUI_TOOLKIT_H_
|
||||
#define __GSTGUI_TOOLKIT_H_
|
||||
|
||||
#include <glibconfig.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
18
Primitives.h
18
Primitives.h
@@ -93,4 +93,22 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//// Draw a Rectangle (triangle strip) with a texture
|
||||
//class ObjModel : public Primitive {
|
||||
|
||||
//public:
|
||||
// ObjModel(const std::string& path = "" );
|
||||
|
||||
// void init () override;
|
||||
// void draw (glm::mat4 projection) override;
|
||||
// void accept (Visitor& v) override;
|
||||
|
||||
// std::string getFilename() { return filename_; }
|
||||
|
||||
//protected:
|
||||
// std::string filename_;
|
||||
// uint textureindex_;
|
||||
//};
|
||||
|
||||
|
||||
#endif // PRIMITIVES_H
|
||||
|
||||
@@ -313,7 +313,7 @@ void Rendering::PopAttrib()
|
||||
|
||||
glm::mat4 Rendering::Projection()
|
||||
{
|
||||
glm::mat4 projection = glm::ortho(-5.0, 5.0, -5.0, 5.0);
|
||||
glm::mat4 projection = glm::ortho(-5.0, 5.0, -5.0, 5.0, -5.0, 5.0);
|
||||
glm::mat4 scale = glm::scale(glm::mat4(1.0f), glm::vec3(1.f, AspectRatio(), 1.f));
|
||||
|
||||
return projection * scale;
|
||||
|
||||
6
main.cpp
6
main.cpp
@@ -51,11 +51,13 @@
|
||||
//// ("file:///home/bhbn/Videos/TestFormats/_h264GoldenLamps.mkv");
|
||||
//// ("file:///home/bhbn/Videos/TestEncoding/vpxvp9high.webm");
|
||||
//// ("file:///home/bhbn/Videos/iss.mov");
|
||||
//// ("file:///home/bhbn/Videos//iss.mov");
|
||||
//// ("file:///Users/Herbelin/Movies/mp2test.mpg");
|
||||
///
|
||||
Scene scene;
|
||||
FrameBuffer *output;
|
||||
MediaSurface testnode1("file:///Users/Herbelin/Movies/iss.mov");
|
||||
MediaSurface testnode2("file:///Users/Herbelin/Movies/mp2test.mpg");
|
||||
MediaSurface testnode1("file:///home/bhbn/Videos/iss.mov");
|
||||
MediaSurface testnode2("file:///home/bhbn/Videos/fish.mp4");
|
||||
ImageSurface testnode3("images/v-mix_256x256.png");
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user