////////////////////////////////////////////////////////////////////// // // Pixie // // Copyright © 1999 - 2003, Okan Arikan // // Contact: okan@cs.berkeley.edu // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // File : fbw.cpp // Classes : CWinDisplay // Description : Implements a window that display the image // //////////////////////////////////////////////////////////////////////// #include "framebuffer.h" #include "fbw.h" // Foward declarations of functions included in this code module: LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); #define color(r,g,b,a) ((a << 24) | (r << 16) | (g << 8) | b) #define get_a(col) ((col) >> 24) #define get_r(col) (((col) >> 16) & 255) #define get_g(col) (((col) >> 8) & 255) #define get_b(col) ((col) & 255) /////////////////////////////////////////////////////////////////////// // Function : displayThread // Description : Starts the display thread // Return Value : // Comments : // Date last edited : 11/28/2001 DWORD WINAPI displayThread(void *w) { CWinDisplay *cDisplay = (CWinDisplay *) w; // The thread main loop cDisplay->main(); return 0; } /////////////////////////////////////////////////////////////////////// // Class : CWinDisplay // Method : CWinDisplay // Description : Ctor // Return Value : - // Comments : // Date last edited : 8/8/2002 CWinDisplay::CWinDisplay(const char *name,const char *samples,int width,int height,int numSamples) : CDisplay(name,samples,width,height,numSamples) { int i,j; DWORD threadID; hInst = NULL; hWnd = NULL; imageData = new unsigned int[width*height]; // Create a checkerboard pattern for (i=0;i