Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, May 8, 2007

Learning OpenGL

OpenGL is an event driven multi-platform graphics. OpenGL is supported on every major operating system and is compliant with most programming languages. It is a software interface to a graphics system implemented in hardware or software. This interface consists of in excess of 120 distinct commands, which can be used to specify the objects and operations needed to produce interactive three-dimensional graphics applications.

There are numerous online tutorials for learning how to use OpenGL. Some of the best of these can be found on the following websites:

http://www.morrowland.com/apron/tut_gl.php
http://nehe.gamedev.net/

The following tutorials is a detailed description of how to set up an OpenGL application in Microsoft Visual Studio. Which can be helpful when starting out:

http://csf11.acs.uwosh.edu/cs371/visualstudio/

Also, The OpenGL Programming Guide commonly referred to as "The Red Book" cane helpful. The following are links to a html version and the coded examples included in the book:


http://fly.cc.fer.hr/~unreal/theredbook/

http://www.opengl.org/resources/code/samples/redbook/


Friday, May 4, 2007

Simple "Hello World" in 10 Popular Languages

When starting to learn a new programming language quite often the first program that one learns is a simple program which prints "Hello World" to the screen. The following is a small collection of these programs in 10 popular programming languages:

PHP


<?php
// Hello World in PHP
echo 'Hello World!';
?>

C#

// Hello World in Microsoft C# ("C-Sharp").

using System;

class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello, World!");
return 0;
}
}

JavaScript

<html>
<body>
<script language="JavaScript" type="text/javascript">

// Hello World in JavaScript
document.write('Hello World');
</script>
</body>
</html>

Perl

# Hello world in perl

print "Hello World!\n";

C-Windows

/* Hello world in C for MS-Windows */

#include <windows.h>

int PASCAL WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance, LPSTR CmdLine, int Show)
{
MessageBox(GetActiveWindow(), "Hello World!", "Hello Windows World", MB_OK);
return 0;
}

C++-ISO

// Hello World in ISO C++

#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
}

Ruby

# Hello World in Ruby
puts "Hello World!"

Java

// Hello World in Java

import java.io.*;
class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}

Python

# Hello World in Python
print "Hello World"

VisualBasic.NET

'Hello World in Visual Basic .NET (VB.NET)

Imports System.Console

Class HelloWorld

Public Shared Sub Main()
WriteLine("Hello, world!")
End Sub

End Class