Skip to content
Snippets Groups Projects
Commit e2c01fc8 authored by bobarna's avatar bobarna
Browse files

started setting up the project

parent 827a6ee8
No related branches found
No related tags found
No related merge requests found
### C
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
### C++
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
### JetBrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
cmake_minimum_required(VERSION 3.17)
project(madid)
set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -pedantic")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic")
add_executable(${PROJECT_NAME}
src/main.cpp src/utility/constants.h src/utility/gl.h src/utility/application.cpp src/utility/application.h)
# opengl
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
# glfw
find_package(glfw3 REQUIRED)
include_directories(${GLFW_INCLUDE_DIRS})
link_libraries(${GLFW_LIBRARY_DIRS})
# glew
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
target_link_libraries(
${PROJECT_NAME}
glfw
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
)
\ No newline at end of file
// Math
#include <glm/glm.hpp>
#include <iostream>
#include <memory>
#include "utility/application.h"
int main(int argc, char **argv) {
/* Creating a GLFW application */
std::shared_ptr<Application> application = std::make_shared<Application>()
glutInit( &argc, argv );
OpenTissue::glut::instance_pointer application = init_glut_application(argc,argv);
OpenTissue::glut::set_application_instance(application);
glutInitDisplayMode( GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE );
glutInitWindowSize( application->width(), application->height() );
glutInitWindowPosition( 50, 50 );
application->main_window() = glutCreateWindow( application->get_title() );
application->init_gl_state();
int main_menu = glutCreateMenu( &OpenTissue::glut::menu );
application->init_right_click_menu( main_menu, &OpenTissue::glut::menu );
glutSetMenu( main_menu );
glutAttachMenu( GLUT_RIGHT_BUTTON );
application->init();
glutDisplayFunc ( &OpenTissue::glut::display );
glutReshapeFunc ( &OpenTissue::glut::reshape );
glutMouseFunc ( &OpenTissue::glut::mouse );
glutMotionFunc ( &OpenTissue::glut::motion );
glutPassiveMotionFunc( &OpenTissue::glut::motion );
glutKeyboardFunc( &OpenTissue::glut::key );
glutSpecialFunc ( &OpenTissue::glut::specialkey );
glutMainLoop();
application->shutdown();
}
#include "application.h"
Application::Application(){
}
Application::~Application() {
}
\ No newline at end of file
#ifndef MADID_APPLICATION_H
#define MADID_APPLICATION_H
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <iostream>
#include "constants.h"
class Application {
bool dragging = false;
int keyArr[350];
public:
Application();
~Application();
};
#endif //MADID_APPLICATION_H
#ifndef MADID_CONSTANTS_H
#define MADID_CONSTANTS_H
#endif //MADID_CONSTANTS_H
#ifndef MADID_GL_H
#define MADID_GL_H
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment