You are on page 1of 1

#include <iostream>

#include <GLFW/glfw3.h>
#include "points.h"
#include "plot.h"
#include "triangle.h"
#include "signals_ecg.h"
using namespace std;

int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!

GLFWwindow* window;
if (!glfwInit())
return 0;

window = glfwCreateWindow(640*2, 480, "Data Visualization", NULL, NULL);


if (!window){
glfwTerminate();
return 0;
}
glfwMakeContextCurrent(window);
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
while (!glfwWindowShouldClose(window)){
int width, height;
glfwGetFramebufferSize(window, &width, &height);
float ratio = (float) width / (float)height;
glViewport(0, 0, width, height);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//Orthographic Projection
glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

drawPointsDemo(width, height);
drawLineDemo();
drawTriangleDemo();
linePlotDemo(phase_shift+=0.02f);
ecg_demo(ratio);

glfwSwapBuffers(window);
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}

You might also like