Delphi vs Alternatives

Broad comparison of programming enviroments (IDE’s) with internal GUI support:

  • Delphi / C++ Builder Community Edition (WINNER)
    • Free (for yearly income under $5000)
    • Small executable file
    • Very fast execution
    • Very fast compiling
    • No external software requirement
    • Good Cross-Platform support
  • Visual Studio
    • Free
    • Small executable file
    • Very fast execution
    • Fast compiling
    • External software requirement (.Net Framework)
    • Very Bad Cross-Platform support (Xamarin sucks)
  • Qt
    • Only free for open source projects
    • Very large executable file
    • Fast execution
    • Slow compiling
    • No external software requirement
    • Very good Cross-Platform support
  • Java
    • Free (with limitations)
    • Small executable file
    • Slow execution
    • Slow compiling
    • External software requirement (Java Virtual Machine)
    • Good Cross-Platform support
Advertisements

GPIO Programming for Raspberry Pi using C

#include 

int main() {
    wiringPiSetup ();
    pinMode(7, OUTPUT);
    for (short i = 1; i <= 5; i++) {
        digitalWrite(7, HIGH);
        delay(1000);
        digitalWrite(7, LOW);
        delay(1000);
    }
    return 0;
}

Compile and run

g++ ledtest.cpp -o ledtest -lwiringPi
sudo ./ledtest

How to Install GLUT to Dev C++

GLUT is a platform-independent OpenGL library. We need to follow the steps below in order to use it on Dev C++

  • glut.h – Copy to C:Dev-CppincludeGL
  • glut32.def – Copy to C:Dev-Cpplib
  • glut32.dll – Copy to C:WINDOWSsystem32

 

Let’s try it:

#include <glgl.h>
#include <glglut.h>
void init(void);
void display(void);

int main(int argc, char *argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowSize(250,250);
glutInitWindowPosition(100,200);
glutCreateWindow("My OpenGL Application");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

void init(void)
{
glClearColor(0.0f ,0.0f ,0.0f ,0.0f);
glColor3f(0.0f,0.0f,1.0f);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)250/(GLfloat)250,0.1f,100.0f);
}

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3f( 0.0f, 1.0f, -10.0f);
glVertex3f(-1.0f,-1.0f, -10.0f);
glVertex3f( 1.0f,-1.0f, -10.0f);
glEnd();
glutSwapBuffers();
}