Advertisement Jump to content
  • Advertisement

miminawewe

Member
  • Content Count

    205
  • Joined

  • Last visited

Community Reputation

121 Neutral

About miminawewe

  • Rank
    Member
  1. miminawewe

    diffuse light calculation

    I think lightPos[0] has already been transformed to view space as an optimization to prevent it from being redundantly calculated all the time in the vertex shader for each vertex. That was not mentioned in the code.
  2. Why isn't the lightPos[0] in the code below transformed by gl_ModelViewMatrix before the subtraction with the transformed vertex V in the vertex shader code below? uniform vec3 lightPos[1]; ... gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; vec3 N = normalize(gl_NormalMatrix * gl_Normal); vec4 V = glModelViewMatrix * gl_Vertex; vec3 L = normalize(lightPos[0] - V.xyz); ... Correct me if I'm wrong but isn't V in camera space while lightPos[0] is left in world space, thus wouldn't it be wrong to subtract the 2 values?
  3. miminawewe

    OpenGL hangs in Visual C++ Express

    The problem is also in borland turbo C++. I think the problem is the graphics adapter. It's an S3 prosavage/twister v1.1 2.40.103 It seems like if I set GL_CLAMP, Windows hangs, and if I don't set it or set GL_REPEAT it works. Is there a place where I can see issues that various cards and adapters have? I think this will be a very important resource for anyone developing graphics applications especially OpenGL/DirectX.
  4. miminawewe

    OpenGL hangs in Visual C++ Express

    Thanks for the try/catch, that I didn't know. Sorry it's not the app that hangs but the OS (Windows 2000).
  5. miminawewe

    OpenGL hangs in Visual C++ Express

    The loop runs a couple of times then it hangs. The hanging is irregular so breaking might not work. The try / catch was for some c++ code which I have commented out. I thought it only slows down an application if an exception occurs but if none occurs then it's OK.
  6. When I try and run an OpenGL app in C++ Express it hangs most of the time. What's up with that? [EDIT]I've added more code //--------------------------------------------------------------------------- #include "File1.h" #include <windows.h> #include <gl/gl.h> #include <gl/glu.h> #pragma hdrstop //--------------------------------------------------------------------------- LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); BOOL InitInstance(HINSTANCE, int); HINSTANCE hInst; char szTitle[10] = "test"; // The title bar text char szWindowClass[10] = "test1"; const unsigned short SCREEN_WIDTH = 800, SCREEN_HEIGHT = 600; BYTE SCREEN_COLORBITS = 32, SCREEN_DEPTH = 16; COGL ogl; #pragma argsused WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; WNDCLASSEX wndclassex = {0}; // Fill the fields we care about wndclassex.cbSize = sizeof(WNDCLASSEX); wndclassex.style = CS_HREDRAW | CS_VREDRAW; wndclassex.lpfnWndProc = WndProc; wndclassex.hInstance = hInstance; wndclassex.lpszClassName = szWindowClass; wndclassex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); //wndclassex.hCursor = (HCURSOR)LoadImage(NULL, MAKEINTRESOURCE(IDC_CROSS), IMAGE_CURSOR, 0, 0, LR_SHARED); //wndclassex.hCursor = (HCURSOR)LoadImage(NULL, "images/Cursor1.cur", IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE); wndclassex.hCursor = LoadCursor(NULL, IDC_ARROW); RegisterClassEx(&wndclassex); if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } GLuint texture_id; glGenTextures(1, &texture_id); // Bind the texture to the texture arrays index and init the texture glBindTexture(GL_TEXTURE_2D, texture_id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); GLint internal_format = GL_RGB8; glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); const unsigned int image_width = 512; const unsigned int image_height = 512; const unsigned int cui_tmp = image_width*image_height*3; GLubyte *image_data_tmp = new GLubyte[cui_tmp]; for(int i=0; i<cui_tmp; ++i) image_data_tmp = 0; glTexImage2D(GL_TEXTURE_2D, 0, internal_format, image_width, image_height, 0, GL_RGB, GL_UNSIGNED_BYTE, image_data_tmp); delete[] image_data_tmp; while(!GetAsyncKeyState(VK_ESCAPE)) { if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if(msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); }//end if else { //ref_playingobj.ogg_mmplayer.playMM(b_endofplayback, ref_playingobj.quad_coords); //ogl.MainLoop(playmediafile); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glBindTexture(GL_TEXTURE_2D, texture_id); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex2s(0, 0); glTexCoord2f(0.0, 0.9375f); glVertex2s(0, 600); glTexCoord2f(0.6875f, 0.9375f); glVertex2s(800, 600); glTexCoord2f(0.6875f, 0.0); glVertex2s(800, 0); glEnd(); glFlush(); SwapBuffers(ogl.hdc); }//end else } // end of while ReleaseDC(ogl.hwnd, ogl.hdc); // Be sure to free up the window's HDC wglMakeCurrent(NULL, NULL); // Set render context back wglDeleteContext(ogl.hglrc); // Delete render context ogl.hglrc = NULL; ogl.hdc = NULL; UnregisterClass(szWindowClass, hInstance); // Free up the WNDCLASSEX return 0; } //--------------------------------------------------------------------------- BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hInst = hInstance; // Store instance handle in our global variable RECT rect = { 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT }; // Desired window client rect DWORD winStyleEx = WS_EX_APPWINDOW; DWORD winStyle = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; //DWORD winStyle = WS_CAPTION | WS_SYSMENU; // Window style //DWORD winStyle = WS_MAXIMIZE; // Adjust window rect so it gives us our desired client rect when we AdjustWindowRectEx(&rect, winStyle, false, winStyleEx); hWnd = /*CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);*/ CreateWindowEx(winStyleEx, szWindowClass, szTitle, winStyle, 0, 0, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } ogl.hwnd = hWnd; ogl.hdc = GetDC(hWnd); //ChangeToFullScreen(); if(!ogl.initOGL((BYTE)SCREEN_COLORBITS, (BYTE)SCREEN_DEPTH)) { UnregisterClass(szWindowClass, hInstance); // Free up the WNDCLASSEX return EXIT_FAILURE; // Something bad happened }//end if ogl.setupOGL(); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } //------------------------------------------------------------------------------------ // // FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } //------------------------------------------------------------------------------------ // Message handler for about box. //------------------------------------------------------------------------------------ bool COGL::initOGL(const BYTE &colorBits, const BYTE &depthBits) { // Set the pixel format if(!setPixelFormat(colorBits, depthBits)) return false; // Set the render context if(!setRenderContext()) return false; return true; } //------------------------------------------------------------------------------------ bool COGL::setPixelFormat(const BYTE &colorBits, const BYTE &depthBits) { // Declare a pixel format descriptor PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd 1, // version number PFD_DRAW_TO_WINDOW | // support window PFD_SUPPORT_OPENGL | // support OpenGL PFD_DOUBLEBUFFER, // double buffered PFD_TYPE_RGBA, // RGBA type 24, // 24-bit color depth 8, 0, 8, 0, 8, 0, // color bits ignored 8, // no alpha buffer 0, // shift bit ignored 0, // no accumulation buffer 0, 0, 0, 0, // accum bits ignored 16, // 24-bit z-buffer 0, // no stencil buffer 0, // no auxiliary buffer PFD_MAIN_PLANE, // main layer 0, // reserved 0, 0, 0 // layer masks ignored }; // Choose a compatible pixel format (storing the pixel format index in "result") int result = ChoosePixelFormat(hdc, &pfd); // Error Check if(result == 0) return false; // Attempt to set the pixel format if(!SetPixelFormat(hdc, result, &pfd)) return false; return true; // Success } //------------------------------------------------------------------------------------ bool COGL::setRenderContext() { // Create the OpenGL render context hglrc = wglCreateContext(hdc); // Error Check if(hglrc == NULL) return false; // Make it the current render context if(!wglMakeCurrent(hdc, hglrc)) { DWORD ii = GetLastError(); return false; }//end if //set view port glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, (GLdouble) SCREEN_WIDTH, 0.0, (GLdouble) SCREEN_HEIGHT, -1.0, 1.0); //gluPerspective(60.0f,(GLfloat)SCREEN_WIDTH/(GLfloat)SCREEN_HEIGHT, CAMNEAR, CAMFAR); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); return true; // Success } //------------------------------------------------------------------------------------ void COGL::setupOGL() { glEnable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glEnable(GL_CULL_FACE); glClearColor(1.0f, 1.0f, 1.0f, 1.0f); glClearDepth(1.0f); glFrontFace(GL_CW); glCullFace(GL_BACK); glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //glPixelStorei ( GL_UNPACK_ALIGNMENT, 4 ); //glPixelStorei ( GL_PACK_ALIGNMENT, 4 ); //let mouse be in the middle of the window SetCursorPos(int(SCREEN_WIDTH >> 1), int(SCREEN_HEIGHT >> 1)); } [Edited by - miminawewe on January 30, 2008 6:03:48 AM]
  7. miminawewe

    Weird Segmentation Error(s)

    Did you solve the problem? The destructor of a base class (a class that can be inherited) has to be virtual. In JBox::JBox(JStatsManager * stats) {...} code you posted, when you call getAnimationManager(); and getBoundingBox(); where do the pointers returned by those functions go. How do you delete that memory? How does boundingBox in void JBox::createBoundingBox() get it's value? From all the Js I can see I assume you are a Java developer ;)
  8. miminawewe

    Why does my computers clock keeps changing?

    slayemin: 8D 8D 8D
  9. miminawewe

    Weird Segmentation Error(s)

    It would be better if you can show us all the code, or at least give a very clear description of the code. C/C++ is tricky. E.g. if you are using vectors (from the STL) and you had a pointer to one of the elements in the vector then you push_back() another element the vector can re-allocate memory to store the element you just pushed in case there is not enough to store it in the currently allocated memory of storing the elements thus the pointer above references an element that has been removed (and re-allocated to another place in memory). This is just an example of how interesting things can be in C++.
  10. Hi y'all, I started a thread on this topic last October (thread is now closed). I'm back to the topic again. I'm starting to think there is no library that can play Vorbis & Theora . I wanted to create an animated movie clip for my game and the sound would be encoded in Vorbis, movie frames in Theora, all packed into an Ogg file. The library (I call it a Multimedia library) would have the feature of loading an Ogg file and playing sound only (if the Ogg file has sound only), movie only (if the Ogg file has movie frames only) or both. It would also be responsible for managing multimedia playback (I guess this is a good candidate for multi threading). I made good progress last time and I'm resuming now. Before I spend many hours doing this I wanted to make sure that there is no library I can license that can do this for me. Thanks.
  11. miminawewe

    gamespy statistics

    Can you please tell me more about what you have just said? I've never heard of "Clans" and this kind of ISP setup. You may also point me to a website with this info. Thanks.
  12. miminawewe

    gamespy statistics

    I was taking a look at the "Top Game Servers By Players" statistics at gamespy and read this: "35089 servers, 85617 players" for Half Life. Does it mean that there are 35089 servers serving 85617 players in a client-server setup? This comes to about 2.4 players/server. Assuming a server has about 10 players will that be enough to maintain the server? I'm asking this because I have read quite a number of threads talking about how expensive it is to host a server for online games. Thanks.
  13. I'm wondering whether someone has experience with Video Game Design Pro 2006 for Windows. I came across it at Video Game Design Document Template BTW: IF you have experience with gaming hardware I kindly need your input THANKS
  14. miminawewe

    Is this price OK?

    What do you think of Maingear? Their specs and customisation options are closest to what I want. I got the following from their website: (I am interested in 3 PCs with different specs. Figures rounded upwards to the nearest USD) PC 1 (USD 2854) 1. Case (Silver Brushed Aluminum Finish, Translucent Window Side Panel w/ LED Lighting Bundle). 2. 1000W Silverstone Strider Power Supply 3. NVIDIA nForce 680i SLI Motherboard 4. Q6600 Core 2 Quad (2.4GHz x 4) 5. Intel Quiet CPU Cooler 6. 2GB Corsair XMS2-8500 DDR2-1066 7. Western Digital Caviar SE16 250GB 7200RPM 16MB Cache - SATA II 8. Optical Drive: 20X Dual Layer DVD±RW Drive w/ LightScribe Technology - black 9. NVIDIA® GeForce™ 8800GT 512MB DDR3 10. Integrated 8-channel High Definition Audio 11. Dual Gigabit LAN 12. Plantronics DSP-500 USB Digital Headset w/MIC 13. SAMSUNG 204BW Black 20" 6ms DVI Widescreen LCD Monitor 14. Microsoft Windows XP Professional Edition 15. Logitech® G15 Gaming Keyboard 16. No mouse (I want to buy TrackMan Wheel Trackball Mouse for PC or Mac(USB and PS/2) USD 30 from Logitech or Microsoft® Trackball Optical. Which is better?) 17. 1 Year Maingear Warranty OR (USD 2312) 1. Case(Silver Brushed Aluminum Finish) 2. 1000W MAINGEAR Power Supply 3. Asus P5N-E SLI nForce 650i SLI Motherboard 4. Q6600 Core 2 Quad (2.4GHz x 4) 5. Intel Quiet CPU Cooler 6. 2GB Corsair XMS2 PC2 6400 7. Western Digital Caviar SE16 250GB 7200RPM 16MB Cache - SATA II 8. 20X Dual Layer DVD±RW Drive w/ LightScribe Technology - black 9. NVIDIA GeForce 8600GT 256MB PCIe 10. Onboard 8-channel High Definition Audio 11. Dual Gigabit LAN 12. Linksys Wireless 802.11g WMP54G PCI Network Adapter 13. US Robotics 56K V.92 Internal Faxmodem PCI 14. Plantronics DSP-500 USB Digital Headset w/MIC 15. SAMSUNG 204BW Black 20" 6ms DVI Widescreen LCD Monitor 16. Microsoft Windows XP Professional Edition 17. Logitech® G15 Gaming Keyboard 18. No mouse (I want to buy TrackMan Wheel Trackball Mouse for PC or Mac(USB and PS/2) USD 30 from Logitech or Microsoft® Trackball Optical. Which is better?) 19. 1 Year Maingear Warranty PC 2 (USD 1785) 1. Case (Silver Brushed Aluminum Finish) 2. MAINGEAR 750W Ultra Quiet Power Supply 3. Asus P5N-E SLI nForce 650i SLI 4. E6320 Core 2 (1.86GHz x 2) 5. Intel Quiet CPU Cooler 6. 2GB Corsair XMS2 PC2 6400 7. Western Digital Caviar SE16 250GB 7200RPM 16MB Cache - SATA II 8. 16X DVD-ROM - Black 9. NVIDIA GeForce 8600GT 256MB PCIe (Will replace this with Geforce 7800) 10. Onboard 8-channel High Definition Audio 11. Dual Gigabit LAN 12. Linksys Wireless 802.11g WMP54G PCI Network Adapter 13. Plantronics DSP-500 USB Digital Headset w/MIC 14. SAMSUNG 204BW Black 20" 6ms DVI Widescreen LCD Monitor 15. Microsoft Windows Vista Home Premium (32-Bit) 16. Saitek Eclipse Gaming Keyboard - Free Paint Match! 17. Logitech® G5 Laser Mouse - Free Paint Match! 18. 1 Year Maingear Warranty PC 3 (USD 1563) 1. Case(Black Brushed Aluminum Finish) 2. MAINGEAR 750W Ultra Quiet Power Supply 3. ASUS M2R32-MVP AMD 580X CrossFire 4. AMD Athlon 64 X2 4200+ AM2 (2.2GHz) 5. AMD Quiet CPU Cooler 6. 2GB Corsair XMS2 PC2 6400 7. Western Digital Caviar SE16 250GB 7200RPM 16MB Cache - SATA II 8. 16X DVD-ROM - Black 9. ATI Radeon HD 2600XT 256MB (But I'm changing to Radeon X1800. I figure the Geforce 7&8 above are OK for heavier graphics) 10. Integrated 8-channel High Definition Audio 11. Integrated Gigabit Network Card 12. Plantronics DSP-500 USB Digital Headset w/MIC 13. SAMSUNG 204BW Black 20" 6ms DVI Widescreen LCD Monitor 14. Microsoft Windows Vista Home Premium (32-Bit) 15. Logitech® G15 Gaming Keyboard 16. Logitech® G5 Laser Mouse - Free Paint Match! 17. 1 Year Maingear Warranty [Edited by - miminawewe on November 5, 2007 11:22:36 PM]
  15. I'm from Nairobi, Kenya (East Africa). The pictures are from different countries in Africa: Country: Uganda. This vehicle was seen near Makerere - and its not full Country: Kenya. Did you notice where the electiric pole is located? It was seen in Buru Buru, Nairobi - the electricity company was not paid money by the roads dept. to remove the pole, so they left it there. I wonder how they compacted the road. Country: Eritrea. These guys must have smoked weed! Look at the goat. Dont you hate its guts? I think they are transporting MBANJE (weed) inside the goat..hahahahaaaaaaaa..........clever eehhhhhhhh! Country: Unknown. Human ingenuity? Painting the swimming pool Country: Zimbabwe. Must be Zimbabwe - fuel served at the back, by Makorokoza Country: Tanzania. This is definitely in Dar es Salaam due to negative influence of Swahili overdose Country: Unknown.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!