Posts

Day 2 of the Level Editor project

We need to poll the mouse, so we define a new class: #ifndef _MOUSE_H_ #define _MOUSE_H_ class Mouse { public: BOOL buttonPressed; unsigned int coordX; unsigned int coordY; }; #endif In the class GL_Window we create a new variable Mouse *mouse; that references to this class. In our Initialize method of class Game, we write g_mouse = window->mouse; so that we can reference to the mouse data by means of g_mouse in analogy to g_keys. To the Window method, we add the following lines: case WM_LBUTTONDOWN: window->mouse->buttonPressed = true; window->mouse->coordX = GET_X_LPARAM(lParam); window->mouse->coordY = GET_Y_LPARAM(lParam); break; case WM_LBUTTONUP: window->mouse->buttonPressed = false; window->mouse->coordX = GET_X_LPARAM(lParam); window->mouse->coordY = GET_Y_LPARAM(lParam); break; Then we also need a new data structure for keeping up with the level details: class LevelDrawElement { public: LevelE

My latest private project

My latest private project is a level editor for 2D platform games. I started working on it today and I have decided that I would post about my experiences in implementing the project. The motivation is basically life-long interest in game development. As a child I designed a lot of platform games and made sketches using pen and paper. So far, I have not implemented any of these drafts. A level editor would be a good basis to change this. I am working with Visual C++ 2015 and OpenGL. I am using code from the website NeHe for window handling and bitmap drawing. Basically, I am re-using the code of my 2D shooter game "Evolution" since it is a good basis for such a project. The first thing I wanted to change was the shape of the mouse cursor. First of all, in "Evolution" the mouse cursor was disabled. I looked up on MSDN and found out that the mouse cursor can be displayed by writing ShowCursor(1); in the window method. Then I searched for information on how to change t

Österreichs Bildungswesen

Die Partei NEOS, der ich ja auch einige Jahre lang angehört habe, hat sich bekanntlich der Bildung verschrieben. Wenn man über das österreichische Bildungswesen diskutiert, dann müsste ich eigentlich als Referenz dienen, denn ich habe das gesamte öffentliche Bildungssystem von Volksschule bis Doktorat durchlaufen und dazu noch ein weiteres Bachelor-plus-Master-Studium abgeschlossen. Nach meiner Promotion habe ich mich einige Jahre lang mit der Frage beschäftigt, wie ich meine beiden Studienfächer (Medizin und Informatik) sinnvoll kombinieren könnte, und mich unter anderem der Computermodellierung biologischer Systeme zugewandt. Heute weiß ich, dass dieses Gebiet so gut wie tot ist und es keine noch nicht implementierten medizinische Anwendungsprogramme gibt. Es hat sich gezeigt, dass mein eigentliches Interesse der Entwicklung von Computerspielen gilt. Und dafür hätte ich nicht Medizin studieren müssen. Informatik auch nicht derart gründlich, wie ich es getan habe, denn wie man Compute

Zum Thema Religion

Meine Eltern entschieden sich dafür, mich nicht taufen zu lassen, weil sie wollten, dass ich, sobald ich das Erwachsenenalter erreicht habe, mich selbst entschließe, einer Religionsgemeinschaft beizutreten oder auch nicht. Tatsächlich bin ich bis heute ohne Bekenntnis, weil ich mir schon als Kind gedacht habe: Religion ist etwas, das sich ein Mensch ausgedacht hat. Und warum sollte dieser Mensch klüger sein als ich? Im Medizinstudium bin ich vielen Menschen in meinem Alter begegnet, die religiös waren, und offenbar spielte das auch bei der Karriere dieser Leute eine Rolle, denn ich machte die Beobachtung, dass vor allem Mitglieder des römisch-katholischen Cartellverbands nach ihrem Studium eine Anstellung an der Universität erhalten haben. Da ich nicht religiös bin, passe ich nicht in diese Gesellschaft. Leider hat dies auch bedeutet, dass ich keine Hochschulkarriere machen konnte. Obwohl konfessionslos, bin ich aber kein Atheist, denn wenn man Gott nicht unbedingt als ein menschenähnl

Mein Problem mit den Mensanern

Das einzige Problem, das ich mit den Mensanern habe, lässt sich sehr leicht zusammenfassen: Normalerweise gibt es zwei Möglichkeiten, wie ein junger Erwachsener sein Leben gestalten kann: Entweder, er steigt so früh wie nur möglich ins Berufsleben ein. Oder, er investiert noch so viele Jahre wie möglich in seine Bildung, um schließlich auf möglichst hohem Niveau ins Berufsleben einzusteigen. Bei Mensa gibt es einige Mitglieder, die nur den erstgenannten Lebensweg als zulässig betrachten. In dem Milieu, aus dem ich stamme, war es genau umgekehrt. Wenn jemand sagt: "A muss sein, B darf nicht sein" und jemand anderer: "B muss sein, A darf nicht sein", dann sind das Gegensätze, die unüberbrückbar sind. Normalerweise sollte in einer liberalen Gesellschaft jeder für sich selbst entscheiden, was für ihn das Richtige ist.

Big Pharma in Crisis

The last 30 years have brought new technologies to biomedical research, such as the computer simulation of biological systems and machine learning. Despite that, the pharmaceutical industry is in a crisis; only rarely are new "blockbuster" drugs being discovered. This makes me seriously wonder whether the new technologies are overhyped, and it also makes me pose myself the question whether it is a good idea to keep focused on computational systems biology or whether I should invest my sparetime in some other pursuit. I currently maintain the Web Portal on Computational Biology and I have read quite a lot of papers on the subject already, yet perhaps the whole field is not that promising at all.

ASP.NET MVC with EF Core 6

When I tried to set up a new ASP.NET MVC project with Entity Framework Core 6, I ran into some problems until I got the database to work. When I finally had success, I decided that I would share my code. "Api_Entities" is the name of the class that defines the database context. "User" is the name of a table in the database.     public partial class Api_Entities : DbContext     {         public string sqlConnectionString = <your connection string>;         public Api_Entities(DbContextOptions<Api_Entities> options) : base(options)         { }         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)         {             if (optionsBuilder.IsConfigured)             {                 optionsBuilder.UseSqlServer(sqlConnectionString, builder => builder.EnableRetryOnFailure());             }         } In Startup.cs:         // This method gets called by the runtime. Use this method to add services to the container.         publi