xInfinity

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

100 Neutral

About xInfinity

  • Rank
    Newbie
  1. OpenGL load AVI files in opengl problem

    thx for the reply but i still can't solve the problem that i'm stuck with.. void GrabAVIFrame(int frame) // Grabs A Frame From The Stream { LPBITMAPINFOHEADER lpbi; // Holds The Bitmap Header Information lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pgf, frame); // Grab Data From The AVI Stream pdata=(char *)lpbi+lpbi->biSize+lpbi->biClrUsed * sizeof(RGBQUAD); // Pointer To Data Returned By AVIStreamGetFrame // Convert Data To Requested Bitmap Format DrawDibDraw (hdd, hdc, 0, 0, 256, 256, lpbi, pdata, 0, 0, width, height, 0); flipIt(data); // Swap The Red And Blue Bytes (GL Compatability) // Update The Texture glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, 256, 256, GL_RGB, GL_UNSIGNED_BYTE, data); } this line give me the problem pdata=(char *)lpbi+lpbi->biSize+lpbi->biClrUsed * sizeof(RGBQUAD); is that my code can't get AVIStreamGetFrame? sorry i first time import avi video in opengl anyone encounter this problem before please help me..
  2. hey guys, NEED HELP !!!! I trying to load load the avi video using the nehe framework (lesson 35) and opengl for my assignment, I have key in the lib at the linker part (opengl32.lib || glu32.lib || vfw32.lib), but what i got is only a white screen and nothing... can someone help me with my code please !!! Thanks alot //////////////////////////////////////////////////////////////////////////////// // Program : Framework // File : msg.cpp // Note : Include freeglut.lib, glu32.lib & freeglut.dll, // in running directory //////////////////////////////////////////////////////////////////////////////// #include <map> #include <math.h> #include <windows.h> #include "gl/freeglut.h" #include "engine.h" #include <gl\gl.h> // Header File For The OpenGL32 Library #include <gl\glu.h> // Header File For The GLu32 Library #include <float.h> #include <string> #include <fstream> #include <string> #include <vector> #include <mmsystem.h> #include <sstream> #include <vfw.h> // Header File For Video For Windows #include "NeHeGL.h" // Header File For NeHeGL #pragma comment( lib, "opengl32.lib" ) // Search For OpenGL32.lib While Linking #pragma comment( lib, "glu32.lib" ) // Search For GLu32.lib While Linking #pragma comment( lib, "vfw32.lib" ) // Search For VFW32.lib While Linking #pragma once //#pragma comment (lib,"Wimm.lib") //#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) using namespace std; AVISTREAMINFO psi; // Pointer To A Structure Containing Stream Info PAVISTREAM pavi; // Handle To An Open Stream PGETFRAME pgf; // Pointer To A GetFrame Object BITMAPINFOHEADER bmih; // Header Information For DrawDibDraw Decoding long lastframe; // Last Frame Of The Stream int width; // Video Width int height; // Video Height char *pdata; // Pointer To Texture Data int mpf; // Will Hold Rough Milliseconds Per Frame int next; // Used For Animation int frame=0; // Frame Counter int effect; // Current Effect bool bg = true; // Background (Default On) bool env = true; // Environment Mapping (Default On) GLUquadricObj *quadratic; // Storage For Our Quadratic Objects HDRAWDIB hdd; // Handle For Our Dib HBITMAP hBitmap; // Handle To A Device Dependant Bitmap HDC hdc = CreateCompatibleDC(0); // Creates A Compatible Device Context unsigned char* data = 0; // Pointer To Our Resized Image const int menu_state = 1; const int play_state = 2; const int instruction_view_state = 3; int game_state ; // menu button types const int START_BUTTON = 1; const int INSTRUCTION_BUTTON = 2; const int QUIT_BUTTON = 3; const float RAD_TO_DEG = 57.2957795130823208767981548141052f; string fps_string; bool full_screen; float frame_interval; float ground_level; float world_size; void flipIt(void* buffer) // Flips The Red And Blue Bytes (256x256) { void* b = buffer; // Pointer To The Buffer __asm // Assembler Code To Follow { mov ecx, 256*256 // Counter Set To Dimensions Of Our Memory Block mov ebx, b // Points ebx To Our Data (b) label: // Label Used For Looping mov al,[ebx+0] // Loads Value At ebx Into al mov ah,[ebx+2] // Loads Value At ebx+2 Into ah mov [ebx+2],al // Stores Value In al At ebx+2 mov [ebx+0],ah // Stores Value In ah At ebx add ebx,3 // Moves Through The Data By 3 Bytes dec ecx // Decreases Our Loop Counter jnz label // If Not Zero Jump Back To Label } } void OpenAVI(LPCSTR szFile) // Opens An AVI File (szFile) { TCHAR title[100]; // Will Hold The Modified Window Title AVIFileInit(); // Opens The AVIFile Library // Opens The AVI Stream if (AVIStreamOpenFromFile(&pavi, szFile, streamtypeVIDEO, 0, OF_READ, NULL) !=0) { // An Error Occurred Opening The Stream MessageBox (HWND_DESKTOP, "Failed To Open The AVI Stream", "Error", MB_OK | MB_ICONEXCLAMATION); } AVIStreamInfo(pavi, ψ, sizeof(psi)); // Reads Information About The Stream Into psi width=psi.rcFrame.right-psi.rcFrame.left; // Width Is Right Side Of Frame Minus Left height=psi.rcFrame.bottom-psi.rcFrame.top; // Height Is Bottom Of Frame Minus Top lastframe=AVIStreamLength(pavi); // The Last Frame Of The Stream mpf=AVIStreamSampleToTime(pavi,lastframe)/lastframe; // Calculate Rough Milliseconds Per Frame bmih.biSize = sizeof (BITMAPINFOHEADER); // Size Of The BitmapInfoHeader bmih.biPlanes = 1; // Bitplanes bmih.biBitCount = 24; // Bits Format We Want (24 Bit, 3 Bytes) bmih.biWidth = 256; // Width We Want (256 Pixels) bmih.biHeight = 256; // Height We Want (256 Pixels) bmih.biCompression = BI_RGB; // Requested Mode = RGB hBitmap = CreateDIBSection (hdc, (BITMAPINFO*)(&bmih), DIB_RGB_COLORS, (void**)(&data), NULL, NULL); SelectObject (hdc, hBitmap); // Select hBitmap Into Our Device Context (hdc) pgf=AVIStreamGetFrameOpen(pavi, NULL); // Create The PGETFRAME Using Our Request Mode if (pgf==NULL) { // An Error Occurred Opening The Frame MessageBox (HWND_DESKTOP, "Failed To Open The AVI Frame", "Error", MB_OK | MB_ICONEXCLAMATION); } // Information For The Title Bar (Width / Height / Last Frame) wsprintf (title, "Coder", width, height, lastframe); } void GrabAVIFrame(int frame) // Grabs A Frame From The Stream { LPBITMAPINFOHEADER lpbi; // Holds The Bitmap Header Information lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pgf, frame); // Grab Data From The AVI Stream pdata=(char *)lpbi+lpbi->biSize+lpbi->biClrUsed * sizeof(RGBQUAD); // Pointer To Data Returned By AVIStreamGetFrame // Convert Data To Requested Bitmap Format DrawDibDraw (hdd, hdc, 0, 0, 256, 256, lpbi, pdata, 0, 0, width, height, 0); flipIt(data); // Swap The Red And Blue Bytes (GL Compatability) // Update The Texture glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, 256, 256, GL_RGB, GL_UNSIGNED_BYTE, data); } void CloseAVI(void) // Properly Closes The Avi File { DeleteObject(hBitmap); // Delete The Device Dependant Bitmap Object DrawDibClose(hdd); // Closes The DrawDib Device Context AVIStreamGetFrameClose(pgf); // Deallocates The GetFrame Resources AVIStreamRelease(pavi); // Release The Stream AVIFileExit(); // Release The File } BOOL Initialize (GL_Window* window, Keys* keys) // Any GL Init Code & User Initialiazation Goes Here { // Start Of User Initialization hdd = DrawDibOpen(); // Grab A Device Context For Our Dib glClearColor (0.0f, 0.0f, 0.0f, 0.5f); // Black Background glClearDepth (1.0f); // Depth Buffer Setup glDepthFunc (GL_LEQUAL); // The Type Of Depth Testing (Less Or Equal) glEnable(GL_DEPTH_TEST); // Enable Depth Testing glShadeModel (GL_SMOOTH); // Select Smooth Shading glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Set Perspective Calculations To Most Accurate glEnable(GL_TEXTURE_2D); // Enable Texture Mapping glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); // Set Texture Max Filter glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); // Set Texture Min Filter glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); // Set The Texture Generation Mode For S To Sphere Mapping glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); // Set The Texture Generation Mode For T To Sphere Mapping OpenAVI("data/Face2.avi"); // Open The AVI File // Create The Texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, data); return TRUE; // Return TRUE (Initialization Successful) } void Deinitialize (void) // Any User DeInitialization Goes Here { CloseAVI(); // Close The AVI File } void Update (DWORD milliseconds) // Perform Motion Updates Here { next+=milliseconds; // Increase next Based On The Timer frame=next/mpf; // Calculate The Current Frame if (frame>=lastframe) // Are We At Or Past The Last Frame? { frame=0; // Reset The Frame Back To Zero (Start Of Video) next=0; // Reset The Animation Timer (next) } } void Draw (void) // Draw Our Scene { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer GrabAVIFrame(frame); // Grab A Frame From The AVI if (bg) // Is Background Visible? { glLoadIdentity(); // Reset The Modelview Matrix glBegin(GL_QUADS); // Begin Drawing The Background (One Quad) // Front Face glTexCoord2f(1.0f, 1.0f); glVertex3f( 11.0f, 8.3f, -20.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-11.0f, 8.3f, -20.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-11.0f, -8.3f, -20.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 11.0f, -8.3f, -20.0f); glEnd(); // Done Drawing The Background } glFlush (); // Flush The GL Rendering Pipeline } void RenderScene() { glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glClearDepth( 1.0 ); glEnable( GL_DEPTH_TEST ); glDepthFunc( GL_LESS ); glMatrixMode ( GL_MODELVIEW ); glLoadIdentity(); if ( game_state == menu_state ) { glInitNames(); glPushName(0); glEnable( GL_TEXTURE_2D ); glColor3f( 1.0, 1.0, 1.0); glPushMatrix(); // start button glBindTexture( GL_TEXTURE_2D, textures[1].id ); glPushName(START_BUTTON); glTranslatef(0, -0.1, 0); glBegin(GL_QUADS); glTexCoord2f( 0.0 , 0.0 ); glVertex3f( -0.35, 0.2, -2); glTexCoord2f( 1.0 , 0.0 ); glVertex3f( 0.35, 0.2, -2); glTexCoord2f( 1.0 , 1.0 ); glVertex3f( 0.35, 0.4, -2); glTexCoord2f( 0.0 , 1.0 ); glVertex3f( -0.35, 0.4, -2); glEnd(); glPopName(); glPopMatrix(); // high score button //glBindTexture( GL_TEXTURE_2D, textures[4].id ); /*glPushName(INSTRUCTION_BUTTON); glBegin(GL_QUADS); glTexCoord2f( 0.0 , 0.0 ); glVertex3f( -0.35, 0.2, -2); glTexCoord2f( 1.0 , 0.0 ); glVertex3f( 0.35, 0.2, -2); glTexCoord2f( 1.0 , 1.0 ); glVertex3f( 0.35, 0.4, -2); glTexCoord2f( 0.0 , 1.0 ); glVertex3f( -0.35, 0.4, -2); glEnd(); glPopName();*/ // quit button glBindTexture( GL_TEXTURE_2D, textures[3].id ); glPushName(QUIT_BUTTON); glBegin( GL_QUADS ); glTexCoord2f( 0.0 , 0.0 ); glVertex3f( -0.35, -0.1, -3); glTexCoord2f( 1.0 , 0.0 ); glVertex3f( 0.35, -0.1, -3); glTexCoord2f( 1.0 , 1.0 ); glVertex3f( 0.35, 0.1, -3); glTexCoord2f( 0.0 , 1.0 ); glVertex3f( -0.35, 0.1, -3); glEnd(); glPopName(); // menu glPushMatrix(); glTranslatef(0, -1.25, 0); glBindTexture( GL_TEXTURE_2D, textures[0].id ); glBegin(GL_QUADS); glTexCoord2f( 0.0 , 0.0 ); glVertex3f( -1.7, 0.0, -3); glTexCoord2f( 1.0 , 0.0 ); glVertex3f( 1.7, 0.0, -3); glTexCoord2f( 1.0 , 1.0 ); glVertex3f( 1.7, 2.5, -3); glTexCoord2f( 0.0 , 1.0 ); glVertex3f( -1.7, 2.5, -3); glEnd(); glPopMatrix(); } /*if ( game_state == gameover_state ) { glEnable( GL_TEXTURE_2D ); glBindTexture( GL_TEXTURE_2D, textures[7].id ); glBegin(GL_QUADS); glTexCoord2f( 0.0 , 0.0 ); glVertex3f( -0.5, 0.0 , -3); glTexCoord2f( 1.0 , 0.0 ); glVertex3f( 0.5, 0.0 , -3); glTexCoord2f( 1.0 , 1.0 ); glVertex3f( 0.5, 0.75 , -3); glTexCoord2f( 0.0 , 1.0 ); glVertex3f( -0.5, 0.75 , -3); glEnd(); glDisable( GL_TEXTURE_2D ); Print("Press 'Esc' to quit ",220,350, 1.0, 1.0, 1.0 ); }*/ if ( game_state == play_state ) { Draw(); glDisable( GL_DEPTH_TEST ); } /*if ( game_state == highscore_view_state ) { // back button glEnable( GL_TEXTURE_2D ); glBindTexture( GL_TEXTURE_2D, textures[6].id ); glPushName(BACK_BUTTON); glBegin(GL_QUADS); glTexCoord2f( 0.0 , 0.0 ); glVertex3f( -0.35, -0.6, -3); glTexCoord2f( 1.0 , 0.0 ); glVertex3f( 0.35, -0.6, -3); glTexCoord2f( 1.0 , 1.0 ); glVertex3f( 0.35, -0.4, -3); glTexCoord2f( 0.0 , 1.0 ); glVertex3f( -0.35, -0.4, -3); glEnd(); glPopName(); glDisable( GL_TEXTURE_2D ); glEnable( GL_BLEND ); glBlendFunc (GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor3f(1.0f, 1.0f, 1.0f); glBindTexture(GL_TEXTURE_2D, fontTextures[0].id); glMatrixMode ( GL_PROJECTION ) ; glPushMatrix(); glLoadIdentity(); glOrtho(0.0f,640,480,0.0f,-1.0f,1.0f); glMatrixMode(GL_MODELVIEW);glPushMatrix(); glLoadIdentity(); glColor3f(1.0f,0.0f,0.0f); glPrint(260,100, 0,"HIGH SCORES"); glColor3f(1.0,1.0,0.0); multimap <int,string>::iterator i = high_scores.end(); i--; glPrint(210,150,0, ScoreLine( (*i).second,(*i).first ).c_str()); i--; glPrint(210,190,0,ScoreLine( (*i).second,(*i).first ).c_str()); i--; glPrint(210,230,0,ScoreLine( (*i).second,(*i).first ).c_str()); glMatrixMode ( GL_PROJECTION ) ; glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); glDisable( GL_BLEND ); }*/ glDisable( GL_TEXTURE_2D ); glutSwapBuffers(); } void ProcessHits( GLuint id ) { switch( id ) { case START_BUTTON : game_state = play_state; break; case INSTRUCTION_BUTTON : game_state = instruction_view_state; break; case QUIT_BUTTON : glutLeaveMainLoop(); break; } } void ProcessSelection( int mx, int my ) { GLfloat aspect; static GLuint selectBuffer[32]; GLint viewport[4]; int hits; glSelectBuffer(32,selectBuffer); glGetIntegerv(GL_VIEWPORT,viewport); glMatrixMode(GL_PROJECTION); glPushMatrix(); glRenderMode(GL_SELECT); glLoadIdentity(); gluPickMatrix(mx,viewport[3]-my,2,2,viewport); aspect = (float) viewport[2]/(float)viewport[3]; gluPerspective(45.0,aspect,0.1,1000.0); RenderScene(); glRenderMode( GL_RENDER ); hits = selectBuffer[0]; ProcessHits(selectBuffer[ 2 + hits ] ); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); } void Resize( int width, int height ) { glViewport ( 0, 0, width, height ); glMatrixMode ( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 45, (float)(width)/(float)(height), 0.1, 1000 ); glMatrixMode ( GL_MODELVIEW ); glLoadIdentity (); } void NormalKeys( unsigned char key, int x, int y ) { if ( game_state == play_state ) { switch ( key ) { case 27 : glutLeaveMainLoop(); break; default : switch( key ) { default : break; } break; } } } void SpecialKeys( int key, int x, int y ) { switch ( key ) { case GLUT_KEY_UP : break ; case GLUT_KEY_DOWN : break ; case GLUT_KEY_LEFT : break ; case GLUT_KEY_RIGHT : break ; case GLUT_KEY_F1 : break ; case GLUT_KEY_F2 : break ; case GLUT_KEY_F4 : break; default: break; } glutPostRedisplay(); } void ProcessMouseClick( int button, int state, int x, int y ) { switch( button ) { case GLUT_LEFT_BUTTON : ProcessSelection(x,y); break; case GLUT_RIGHT_BUTTON : break; case GLUT_MIDDLE_BUTTON : break; } } void ProcessMouseMove( int x, int y ) {} void InitApp() { full_screen = false; //game_over = false; //game_state = play_state; game_state = menu_state; ground_level = 0.0f; } void InitGL() { glClearColor( 0.0, 0.0, 0.0, 0.0 ); glShadeModel( GL_SMOOTH ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); float hworld_size = world_size / 2.0f; LoadTGA( &textures[ 0 ], "images/menu.tga" ); LoadTGA( &textures[ 1 ], "images/start.tga" ); LoadTGA( &textures[ 2 ], "images/high_score.tga" ); LoadTGA( &textures[ 3 ], "images/quit.tga" ); /*pos.x= 0.0; pos.y= 0.3; pos.z= 3.0; view.x= 0.0; view.y= 0.1; view.z= 0.0; up.x= 0.0; up.y= 1.0; up.z= 0.0; float wall_height= 0.25; float df= world_size/wall_height; // dimension factor objects.insert( map<int,CObject*>::value_type( 0, new CPlane( -hworld_size, ground_level, hworld_size,hworld_size, ground_level, hworld_size,hworld_size, ground_level, -hworld_size,-hworld_size, ground_level, -hworld_size, 0.0f, 0.8f, 0.0f, 0, 1.0f ))); // add back wall objects.insert( map< int, CObject* >::value_type( 1 , ground = new CPlane( -hworld_size, ground_level, -hworld_size,hworld_size, ground_level, -hworld_size,hworld_size, ground_level+ wall_height, -hworld_size,-hworld_size, ground_level+ wall_height, -hworld_size, 1.0f, 1.0f, 1.0f,1.0f,df ))); // add front wall objects.insert( map< int, CObject* >::value_type( 4 , ground = new CPlane( -hworld_size, ground_level, hworld_size,hworld_size, ground_level, hworld_size,hworld_size, ground_level+ wall_height, hworld_size,-hworld_size, ground_level+ wall_height, hworld_size, 1.0f, 1.0f, 1.0f,1.0f,df ))); // add left wall objects.insert( map< int, CObject* >::value_type( 5 , ground = new CPlane( -hworld_size, ground_level, -hworld_size,-hworld_size, ground_level, hworld_size,-hworld_size, ground_level+ wall_height, hworld_size,-hworld_size, ground_level+ wall_height, -hworld_size, 1.0f, 1.0f, 1.0f,1.0f,df ))); // add right wall objects.insert( map< int, CObject* >::value_type( 6 , ground = new CPlane( hworld_size, ground_level, -hworld_size,hworld_size, ground_level, hworld_size,hworld_size, ground_level+ wall_height, hworld_size,hworld_size, ground_level+ wall_height, -hworld_size, 1.0f, 1.0f, 1.0f,1.0f,df ))); objects.insert( map<int,CObject*>::value_type( 2, new CSphere( -0.1f, 0.1f, -0.3f, 0.0f, 0.0f, 1.0f, 0.1f, true, 0.0f))); objects.insert( map<int,CObject*>::value_type( 7, new CSphere( 0.1f, 0.1f, -0.6f, 0.0f, 0.0f, 1.0f, 0.1f, true, 0.0f))); objects.insert( map<int,CObject*>::value_type( 8, new CSphere( 0.3f, 0.1f, -0.8f, 0.0f, 0.0f, 1.0f, 0.1f, true, 0.0f))); //objects.insert( map<int,CObject*>::value_type( 3, // new CCube( 0.0f, ground_level+ 0.1f, 0.0f, 0.0f, 0.9f, 0.9f, 0.1f, true, 0.01f, true, true))); player = new CCube( 0.0f, 0.1f, 0.0f, 0.0f, 0.9f, 0.9f, 0.1f, true, 0.01f, true, false); // objects.insert( map<int,CObject*>::value_type( 5, // new CCube( 0.0f, ground_level + 0.1f, 0.0f, 0.0f, 0.9f, 0.9f, 0.1f, true, 0.01f, true, true))); pos.x = 0.0; pos.y = 1.1; pos.z = hworld_size; view.x = 0.0; view.y = 0.1; view.z = 0.0; up.x = 0.0; up.y = 1.0; up.z = 0.0; camera = new CCamera(); camera->Set( pos , player->pos, up , 0.01 );*/ } int main( int argc, char *argv[] ) { glutInit( &argc, argv ); InitApp(); glutInitDisplayMode( GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH ); glutInitWindowSize( 800, 600 ); if (full_screen) { glutGameModeString("800x600:16@60"); glutEnterGameMode(); } else glutCreateWindow( "Team Coder" ); InitGL(); glutIdleFunc( RenderScene ); glutReshapeFunc( Resize ); glutDisplayFunc( RenderScene ); glutKeyboardFunc( NormalKeys ); glutSpecialFunc( SpecialKeys ); glutMouseFunc( ProcessMouseClick ); glutPassiveMotionFunc( ProcessMouseMove ); PlaySound(TEXT("media/Right Here Waiting.wav"),NULL, SND_FILENAME|SND_ASYNC); glutMainLoop(); return 0; } //////////////////////////////////////////////////////////////////////////////// this is what i think at this code got this problem, i don't seem to link to "Vwf.h" Please take look and help me out!!! thanks alot again. (below) void GrabAVIFrame(int frame) // Grabs A Frame From The Stream { LPBITMAPINFOHEADER lpbi; // Holds The Bitmap Header Information lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pgf, frame); // Grab Data From The AVI Stream pdata=(char *)lpbi lpbi->biSize lpbi->biClrUsed * sizeof(RGBQUAD); // Pointer To Data Returned By AVIStreamGetFrame [Edited by - Zahlman on July 12, 2009 1:56:40 AM]
  3. hey guys i got a problem on loading AVI files as i using NeHe lesson guide but program crash have a Unhandled exception at 0x00411f37 in Olympic Games.exe: 0xC0000005: Access violation reading location 0x00000000. pointer on the line of my code pdata = (char *)lpbi+lpbi->biSize+lpbi->biClrUsed * sizeof(RGBQUAD); // Pointer To Data Returned By AVIStreamGetFrame it don't work any can help me please thx
  4. problem with terrain

    here some example.. http://img190.imageshack.us/gal.php?g=81918278.png thanks!
  5. hi all, i have a problem on my terrain as i roll the texture of my water and alpha the water but my terrain look alpha too and is look like below the water but when i zoom in the terrain is not below the water my second terrain don't have this problem
  6. thank anyway..is there anyway for coding? because my image i using is targa file format or can you paste the source code for water effect here and short explanation of the code to me thank for your reply..
  7. Hi all, I'm new here. I want to ask about how to create a water effects on a plane as i find many tutorial, all i don't understand. Anyone have a more simple and easy way to to do it? thank those who help me =D.