![]() |
|
need help getting quicktime to load textures - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Graphics & Audio Programming (/forum-9.html) +--- Thread: need help getting quicktime to load textures (/thread-7100.html) |
need help getting quicktime to load textures - xDexx - May 6, 2003 11:44 AM i have been looking the QTValuePak and this is what i ended up doing in my program. Code: GWorldPtr gw;then here is the drawFile() function Code: void drawFile(const FSSpec *fss, const Rect *boundsRect)my image is 32x32 pixels. it displays an image but its all screwed up and is nothing like the one i made. what am i doing wrong? need help getting quicktime to load textures - OneSadCookie - May 6, 2003 02:02 PM Well for a start 32 * 32 * 4 is 4096, not 160... need help getting quicktime to load textures - xDexx - May 7, 2003 02:44 PM ok so i rewrote some of it and now it draws the image! but its weird, it draws the image right below the apple it isnt even in the window, and the items i drew with open are all discolored and some are missing. i am thinking that i am just not drawing my little image is the right spot, anyone know what i need to do to fix this? thanks for the help! here is my code:Code: GWorldPtr gw;need help getting quicktime to load textures - OneSadCookie - May 7, 2003 03:07 PM You're missing a call to GraphicsImportSetGWorld(gi, gw, NULL) between QTNewGWorldFromPtr and GraphicsImportDraw. need help getting quicktime to load textures - xDexx - May 7, 2003 03:20 PM now i THINK its drawing in the window but i think its enlarging it massivly. i added that line then all that was in the window was a white background and a black line, then i went in to my face.pict and changed the background to blue and now i have a blue screen with a black line. would the GWorld window size be a different ratio and 32x32 is just massive? maybe i need to tell quicktime that the window i have is 640x480 or something? thanks for all your help! you are my hero! -brett need help getting quicktime to load textures - OneSadCookie - May 7, 2003 03:25 PM I suspect you just have your texture coordinates and/or vertex coordinates wrong. Have you changed the projection anywhere? Try using (0, 0), (1, 0), (1, 1), (0, 1) as your texture coordinates. need help getting quicktime to load textures - xDexx - May 7, 2003 03:39 PM that worked! but i dont understand why. when texturing if a square is 600pixels by 300 pixels then when i put a texture on it at (0,0),(1,0),(1,1),(0,1) the texture will fill the whole square? also the way i have it set up is it loads the image everytime it draws about 350 32x32 squares, so it is really slow. how would i load the texture once then refer to it each time i want to each square? thanks! -brett need help getting quicktime to load textures - OneSadCookie - May 7, 2003 03:46 PM Sounds like you need a basic OpenGL tutorial. You can try NeHe (http://nehe.gamedev.net) or jump straight into the red book (http://fly.cc.fer.hr/~unreal/theredbook/) In short, texture ID 1 now has the image associated with it, so if you want to use the texture again, you can just go glBindTexture(GL_TEXTURE_2D, 1); again without the need for the glTexImage2D. Texture coordinates always run 0..1, 0..1 (unless you're using the GL_EXT_texture_rectangle extension, but that's an advanced topic...) need help getting quicktime to load textures - xDexx - May 7, 2003 03:57 PM cool thanks, i will check those out. thanks for all your help! -brett |