PeriDyno 1.0.0
Loading...
Searching...
No Matches
GlfwApp.cpp
Go to the documentation of this file.
1#include "GlfwApp.h"
2
3namespace dyno
4{
5 GlfwApp::GlfwApp(int argc /*= 0*/, char **argv /*= NULL*/)
6 {
7 //A hack to address the slow launching problem
8#ifdef CUDA_BACKEND
9 auto status = cudaSetDevice(0);
10 if (status != cudaSuccess) {
11 fprintf(stderr, "CUDA initialization failed! Do you have a CUDA-capable GPU installed?");
12 exit(0);
13 }
14 cudaFree(0);
15#endif // CUDA_BACKEND
16 }
17
19 {
20 }
21
22 void GlfwApp::initialize(int width, int height, bool usePlugin)
23 {
24 mRenderWindow = std::make_shared<GlfwRenderWindow>();
25
26 mRenderWindow->initialize(width, height);
27 }
28
30 {
31 mRenderWindow->mainLoop();
32 }
33
34 void GlfwApp::setWindowTitle(const std::string& title)
35 {
36 mRenderWindow->setWindowTitle(title);
37 }
38
39}
void setWindowTitle(const std::string &title)
Definition GlfwApp.cpp:34
void initialize(int width, int height, bool usePlugin=false) override
Definition GlfwApp.cpp:22
void mainLoop() override
Definition GlfwApp.cpp:29
GlfwApp(int argc=0, char **argv=NULL)
Definition GlfwApp.cpp:5
std::shared_ptr< GlfwRenderWindow > mRenderWindow
Definition GlfwApp.h:27
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25