Hello everyone, first of all I must say it’s a pleasure to finally become a part of this forum. I’m Bruno from Argentina, and I’m a biomedical engineering student. This year will be my last one, so I’m starting to create my degree project. The idea is a freeware program to visualize volumetric MRI/PET/CT/SPECT data from slices, also making possible to merge different studies and volume segmentation. I’ve made a ray casting engine for this purpose, and now I want to go up one level and use openGL for real-time visualization.
I started with the openGL redbook and another guide (made by a guy named Jose Garcia), and (not surprisingly) got stuck in the first example code. This is my main.cpp :
#include <vcl.h>
#pragma hdrstop
#define GLUT_BUILDING_LIB
#include <GL/glut.h>
#include “main.h”
#pragma package(smart_init)
#pragma resource “*.dfm”
TForm1 Form1;
__fastcall TForm1::TForm1(TComponent Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(20,20);
glutInitWindowSize(500,500);
glutCreateWindow(“OGL”);
glutDisplayFunc(display);
glutMainLoop();
}
void TForm1::display()
{
// a lot of init things here
}
My idea is to create an openGL window when clicking Button1 and draw there. I get these errors:
[C++ Error] Unit1.cpp(26): E2034 Cannot convert ‘void (* (_closure )())()’ to ‘void (*)()’
[C++ Error] Unit1.cpp(26): E2342 Type mismatch in parameter ‘func’ (wanted ‘void (*)()’, got ‘void’)
I hope you can help me! Thank you in advance.