Monday, October 31, 2005

The Man behind Apple and Pixar

Slashdo: Can Your Mouth Become Multilingual?

Thursday, October 27, 2005

Handling DIBs in OpenLGL

Using Bitmaps for OpenGL texture mapping in Microsoft VC

OpenGL and Windows API Programming

Monday, October 24, 2005

Los Alamos bug

High quality volume graphics on consumer pc hardware

Friday, October 21, 2005

Simultaneous Instant Messaging

Thursday, October 20, 2005

Salary expectations in Gaming Industry

Gaming Green


Firefox-based Social Browser Flock Launches



Wednesday, October 19, 2005

Simple computer graphics explanations

For Beginners

TransGaming Releases Fast Software 3D Rendering



Tuesday, October 18, 2005

Visualization and Analysis Methodologies: A Current Perspective

Jayaram K. Udupa, PhD

Object Characteristics:
  • Graded Composition - gradation of scene intensities leads to blurring
  • Hanging-togetherness(gestalt) - voxels seem to hang together

Volume of Interest

Monday, October 17, 2005

Windows Programming

Lecture Notes (open in IE)

Comparison between command line (dos) C++ and Windows version

// std. version

//entry point
void main (void)
printf(:\n There can be only one!!!");

// Windows version

//simple message box

#include //main header
#include //lot of cool macros

//main entry point for all windows programs
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
//call message box API with NULL for parent

//window handle

parent message string title
| | |
MessageBox (NULL,"There can be only one!!!", "My first windows program", MB_OK|MB_ICONEXCLAMATION); <--- style options


} // end WinMain

Window class

everything is a window , including buttons and toolbars

WNDCLASSEX winclass; // holds the class that we create
HWND handle; // generic window handle
Msg message; // generic message

Declare windows fields

Register window class

Create windows

Display window - ShowWindow(hwnd, SW_SHOW); , UpdateWindow()

Event Handler

Processing Messages

// do initialization stuff here

return(0); //return success
} break;

case WM_PAINT:
// simply validate the window
hdc=BeginPaint(hwnd, &ps);

// you would do all your painting here
EndPaint(hwnd, &ps);

return(0); // return success
} break;

// kill the application, this sends the WM_QUIT message
return(0); // return success

default: break;
} //end switch

Main Event Loop

// enter main event loop

// Translate any accelerator keys

// send the message to the window proc

} // end while

// return to the Windows desktop like this
return (msg.wParam);

Different Main Event Loop

// if there is a message in the queue, get it
// test if this is a quit
if (msg.message==WM_QUIT)

//translate any accelerator keys

// send the message to the window proc

} // end if

} // end while

Handle the windows event messages yourself by adding sections to the switch statement in the callback (WinProc). Eg. close window, force repaint, kill application

Postmessage - send to queue for normal processing
Postmessage(hwnd, WM_USER, w, l);

Sendmessage - send message to window bypassing to queue and requiring immediate response
Sendmessage(hwnd, WM_USER, w, l);

wparam and lparam are parameters and will contain information depending on the message being sent to the window

Movable Window

case WM_MOVE:
// extract the position
int xpos = LOWORD (lparam);
int ypos = HIWORD (lparam);

// get a graphics context

// set the foreground color to green
SetTextColor(hdc, RGB(0,255,0));

// set the background color to white
SetBkColor(hdc, RGB(255,255,255));

// set the transparency mode to Opaque
SetBkMode(hdc, OPAQUE);

// draw the size of the window
sprintf(buffer, "WM_MOVE called - New Position = (%d,%d)",xpos, ypos);

TextOut(hdc,0,0,buffer, strlen(buffer));

//release the dc back
ReleaseDC (hwnd,hdc);

} break;


To process the key presses, use the message WM_CHAR

wparam = ASCII character code
lparam = bit code for key state

case WM_CHAR:
// get the character
char ascii_code = wparam;
unsigned int key_state = lparam;

//get a graphics context

//set the foreground color to cyan
SetTextColor(hdc, RGB(0.255,255));

//set the background color to black

//set the transparency mode to OPAQUE

//print the ascii code and key state
sprintf(buffer, "WM_CHAR: Character = %c", ascii_code);

//release the dc back
ReleaseDC(hwnd, hdc);

You can bypass the message passing state by using GetAsynchKeyState()

int virtual_code = (int) wparam;
int key_bits = (int) lparam;

case VK_RIGHT:
case VK_LEFT:
} // end switch

} // end case

for WM_MOUSEMOVE, wparam - button state bits, lparam - loword is x position, hiword is y position

Exhaustion of IPv4 address space

Article from Cisco

Slashdot Discussion

Wednesday, October 12, 2005

Gates urges students to take up computer science

Sunday, October 09, 2005

A first look at GIMP 2.4



Wednesday, October 05, 2005

When to leave that first job?

Slashdot discussion