Jump to content
  • Advertisement

LostinTime

Member
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

122 Neutral

About LostinTime

  • Rank
    Member
  1. LostinTime

    Regarding Shaders

    I am trying to code a small project with Nehe lesson 47, regarding the vertex shader, but I am thinking. Nehe's tutorial used cgCreateProgramFromFile syntax, but if I do not have a cg file, but want to create on my own, how do I go about doing it?, or can I rely on the same file for different purposes?
  2. LostinTime

    Using Sub

    all my textures are binded to a specific quad, all using GL_TEXTURE_2D, before I called the subimage. Each of the other textures were binded and loaded before going into the main loop, so that the textures dont get reloaded and consume RAM.
  3. LostinTime

    Using Sub

    what do you mean? Do you mean that, for example, the rest of my texture uses 2D textures, but my video use 3D Textures?
  4. LostinTime

    Using Sub

    hi, I seem to have a problem of subbing an image using glTexSubImage2D, cause I am running an avi video in my program. BUT, all my other textures also get replaced, and all of my quads now have parts of the movie stuck onto them. Is there any way to isolate the sub so that it sub the image only on one quad, but leave the rest alone?
  5. Okay, so I followed all of Nehe's steps, and I managed to get my video running. However, when I create other textures, the video gets onto them!. I think the problem lies in not binding the avi image onto that specific quad. But I have no idea how to bind. Cause, Nehe uses a char pointer to hold the texture data. I tried casting it while binding, but there is no different.
  6. LostinTime

    AVI in OpenGL

    Re: Sorry, I forgot to define the textures parameteri. Now that I got the first frame, I have no idea how to advance. NeHe defined DWORD milliseconds to move onwards. He gave no defination as to what is it, only that" //Perform Motion Updates Here" To forward the frame, he used next+=milliseconds; // Increase next Based On The Timer frame=next/mpf; // Calculate The Current Frame Where all the parameters are integers. However, when I did it, my frame did not advance. I read about DWORD, and it is similar to LPCSTR( I think), but since I followed Sc4Freak's advice and switch off the Unicode, I am thinking that might be the problem. [Edited by - LostinTime on February 16, 2008 1:50:30 PM]
  7. LostinTime

    AVI in OpenGL

    Hey, I seem to have a problem =( I cant open the avi file I want, even though I opened it in NeHe's Project folder. void OpenAVI(char* szFile) { AVIFileInit(); // Opens The AVIFile Library // Opens The AVI Stream if (AVIStreamOpenFromFile(&pavi, (LPCWSTR)szFile, streamtypeVIDEO, 0, OF_READ, NULL) !=0) it doesnt get pass this lines. The compiler keeps returning me errors, or returns the error message that says I cant open the file. The file has been placed in the correct folder, yet I dont know why?
  8. LostinTime

    AVI in OpenGL

    ah..I see. Done it, now it works. Thanks!
  9. LostinTime

    AVI in OpenGL

    Hi, I read NeHe's tutorial on the avi loading, and I tried to apply it to my project. He used this method to open the file 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, &psi, 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, "NeHe's AVI Player: Width: %d, Height: %d, Frames: %d", width, height, lastframe); SetWindowText(g_window->hWnd, title); // Modify The Title Bar } However, when I tried the same thing, these errors appeared. Can some one help?? Error 1 error LNK2019: unresolved external symbol _AVIStreamGetFrameOpen@8 referenced in function "void __cdecl OpenAVI(wchar_t const *)" (?OpenAVI@@YAXPB_W@Z) AppMain.obj Error 2 error LNK2019: unresolved external symbol _AVIStreamSampleToTime@8 referenced in function "void __cdecl OpenAVI(wchar_t const *)" (?OpenAVI@@YAXPB_W@Z) AppMain.obj Error 3 error LNK2019: unresolved external symbol _AVIStreamLength@4 referenced in function "void __cdecl OpenAVI(wchar_t const *)" (?OpenAVI@@YAXPB_W@Z) AppMain.obj Error 4 error LNK2019: unresolved external symbol _AVIStreamInfoW@12 referenced in function "void __cdecl OpenAVI(wchar_t const *)" (?OpenAVI@@YAXPB_W@Z) AppMain.obj Error 5 error LNK2019: unresolved external symbol _AVIStreamOpenFromFileW@24 referenced in function "void __cdecl OpenAVI(wchar_t const *)" (?OpenAVI@@YAXPB_W@Z) AppMain.obj Error 6 error LNK2019: unresolved external symbol _AVIFileInit@0 referenced in function "void __cdecl OpenAVI(wchar_t const *)" (?OpenAVI@@YAXPB_W@Z) AppMain.obj Error 7 error LNK2019: unresolved external symbol _DrawDibDraw@52 referenced in function "void __cdecl GrabAVIFrame(int)" (?GrabAVIFrame@@YAXH@Z) AppMain.obj Error 8 error LNK2019: unresolved external symbol _AVIStreamGetFrame@8 referenced in function "void __cdecl GrabAVIFrame(int)" (?GrabAVIFrame@@YAXH@Z) AppMain.obj
  10. LostinTime

    Lesson #35

    I am wondering about the lesson 35 on the Avi player. Can the Avi player play all sizes of AVI files, or only certain sizes? I tried a 700 mb avi file (sounds crazy I know, but I just wanted to give it a shot), then, an access violation appeared at the pdata. The glSwapBuffer(window.hDC) also gave an error. What is the problem, if the first question evalutes to the former option?
  11. LostinTime

    3DS Loaders In OpenGL

    Hmm.. Thanks Captain P and empirical2, I didn't think of that. That was finally a good answer to my second question up there. Thanks Deadstar, I ll go ahead and try anyway, to fully learn about the 3D max file formats, but since they made a good point I ll try it, this time with the texture chunk so that I can learn. Thanks to all who answered!!
  12. LostinTime

    3DS Loaders In OpenGL

    Supposedly i have different textures for different parts of these say a table I created..to texture them I would need to layout the texture like that of a cube , isn' it? An open six-figure cube. or something similar. However when I import in I must use a texture specific to one, so like say I want one part of it to be in bump map, the other in tga, wouldnt that kind of inflict with one another? the other solution would be to load the file sperately then texture them accordingly..but loading takes time. Hence, I ll want to try that. My friend suggusted piggy-backing half life engine to get what I want into Opengl, but I dont feel its right, so I am left with this.
  13. LostinTime

    3DS Loaders In OpenGL

    Oh dear... let me get this straight..There isnt any file format out there which allows me to export both the mesh and the texture? ( not talking about custom file formats). Deadstar, do you have a tutorial about writing your own file format? I ll take a shot at it.
  14. LostinTime

    3DS Loaders In OpenGL

    Either by assigning the material inside 3D max itself, or as I load into Vstudio and then assigning bits of the texture loaded which is loaded in a different file. I know that chucks are part of a 3Ds files, but I still dont get how to read the chucks texture. Also, I read about a library being used for 3DS in Vstudio, is that true? I know someone wrote a file using cilo.h and similar headers, but I cant seem to find the full headers for it,or I am confused by the integers beside the code, since they dont correspond to each other( you ll understand when you google for it).
  15. Hi, I been trying to get 3ds loaders and tutorials for my project work. However, so far, most of the 3ds loaders I found had seperate texture loaders that map the coordinates of a texture onto the object. Is there a specific reason for doing so? I ll also gladly appreciate it if someone could give me a link to a webpage that has a tutorial on it (loading the texture of the file from the 3ds file itself). My Compiler is Vstudio and I am using C++ for the project.
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!