setaglib

Members
  • Content count

    47
  • Joined

  • Last visited

Community Reputation

122 Neutral

About setaglib

  • Rank
    Member
  1. MessageBox problems

    This probably won't help but try adding the MB_TOPMOST flag see if that works. Like the above poster said you need to stop updating the graphics try temporarily pausing the game or something similar to that.
  2. Textured Quads

    I'm no expert at this but in your code what I think you should be doing is first assign all the vertices... so: Quad[0].x = (float)dest_x; Quad[0].y = (float)dest_y; Quad[0].rhw = 1.0; Quad[0].tu = 0.0; Quad[0].tv = 0.0; Quad[1].x = (float)dest_x + (source->right - source->left); Quad[1].y = (float)dest_y; Quad[1].rhw = 1.0; Quad[1].tu = 1.0; Quad[1].tv = 0.0; Quad[2].x = (float)dest_x + (source->right - source->left); Quad[2].y = (float)dest_y + (source->bottom - source->top); Quad[2].rhw = 1.0; Quad[2].tu = 1.0; Quad[2].tv = 1.0; Quad[3].x = (float)dest_x; Quad[3].y = (float)dest_y + (source->bottom - source->top); Quad[3].rhw = 1.0; Quad[3].tu = 0.0; Quad[3].tv = 1.0; THEN you lock the vertex buffer VOID* myVertices; m_VertexBuffer->Lock(0, sizeof(Quad), (void**)&Quad, 0); memcpy( myVertices, Quad, sizeof(Quad) ); //copy into myVertices m_VertexBuffer->Unlock(); As for the texture coordinates take a look at the sdk documentation its explained very well in there... This is the code I'm using to draw a textured rectangle in my tetris clone if that helps... void TexRectangle(IDirect3DDevice9* dev,IDirect3DTexture9* texture,float x,float y,float sx,float sy) { Vertex v[4]; v[0].point[0] = x; v[0].point[1] = y; v[0].point[2] = 0.0f; v[0].u = 0.0f; v[0].v = 0.0f; v[1].point[0] = x+sx; v[1].point[1] = y; v[1].point[2] = 0.0f; v[1].u = 1.0f; v[1].v = 0.0f; v[2].point[0] = x; v[2].point[1]= y+sy; v[2].point[2] = 0.0f; v[2].u = 0.0f;v[2].v = 1.0f; v[3].point[0] = x+sx; v[3].point[1] = y+sy; v[3].point[2] = 0.0f; v[3].u = 1.0f; v[3].v = 1.0f; dev->SetFVF(TEXVERTEXFORMAT); dev->SetTexture(0,texture); dev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,(void*)v,sizeof(Vertex)); } [Edited by - setaglib on June 29, 2005 12:50:12 AM]
  3. Dev-C++ Problem

    Err you could use this for now clickster its free right now. Are you completely sure you didn't just download dev-c++ without the compiler? You want the version with mingw(the compiler) included.
  4. i didn't understand lesson 8 (blending)

    You might want to take a look at Nehe's lesson 20 on masking as well... If you are going to use nife's method you may want to consider drawing your images on top of a transparent layer or channel whatever is called...So that you don't have to compute the alpha channel of all the pixels when you load an image. You will need a file format that supports alpha channels of course... :/
  5. std::vector array question

    Well you can still do the same in c++ if you want, nothing wrong with that I guess... If you are going to use a vector you want a single container for the array of strings not an array of vectors [smile]. There are some ways you could initialize a vector for example: std::vector<std::string> v(3); initialize an array with 3 elements std::vector<std::string> v(3,"foo"); //initialize 3 elements that equal foo :) std::vector<std::string> v; //push_back 2 elements into the vector "foo" and "bar" v.push_back("foo"); v.push_back("bar");
  6. tutorial virtual keys

    To be honest I'm not sure about a portable way, but you could use the windows api function GetAsyncKeyState. Look it up in msdn. iirc its used something like: if( GetAsyncKeyState( VK_ESCAPE ) & (1<<15) ) { //user pressed escape }
  7. Which Graphics Cards

    I also have a GeForce 5200 its usually enough to run most of the games I'm working on (currently just a Tetris clone and a crappy rpg). You probably won't need a better card anytime soon; unless you are planning to write Doom 7 [smile]
  8. Please help debug simple DirectX app

    Quote: stega...thanks for your help. The whole point is I am trying to get this code to work so I can LEARN DirectX. If you have to debug a Hello World program then that program is not much good, is it? Yeh know, just trying to give you something to go on, sorry. Didn't mean to take teh fun away [smile]
  9. Please help debug simple DirectX app

    Quote:Original post by Tom Knowlton I am still getting this: Error in the application. -2005530516 (D3DERR_INVALIDCALL) at Microsoft.DirectX.Direct3D.Device..ctor(Int32 adapter, DeviceType deviceType, Control renderWindow, CreateFlags behaviorFlags, PresentParameters[] presentationParameters) at DXChpOne.Form1.InitializeGraphics() in c:\documents and settings\syndi\desktop\dxchpone\form1.cs:line 38 The program '[2840] DXChpOne.exe' has exited with code 0 (0x0). Ok I tried your code and its working for me (both in debug and relase mode) without making any changes. And yeah it'll work without that line also, no problem. It looks like the problem its with CreateDevice so try to find the problem from there. Maybe try running on Software only? I dunno I'm out of ideas...
  10. Please help debug simple DirectX app

    Why doesn't that line compile what error does it give you? Did you notice I edited the post? Because I had a little copy/paste trouble there earlier [embarrass]
  11. Please help debug simple DirectX app

    Quote:Original post by Tom Knowlton One thing that helped (I tried this before realizing you had posted) was to compile in RELEASE mode vs DEBUG. This cleaned-up the problem. Duh, I should have remembered that DirectX is quirky in DEBUG mode. Cool didn't know that it would work without that line. Anyway, I never had problems in debug mode maybe because I have an older version? [smile]
  12. Please help debug simple DirectX app

    I'm guessing it's failing because you didn't pass what format you want to use to PresentParameters so try adding this line presentParams.BackBufferFormat = Format.Unknown; And to look up what the errors mean you can always take a look at msdn EDIT: gah! typo
  13. Non user defined exceptions

    I don't know if this helps but in c++ there are two macros one for the current line called __LINE__ and another one that will give you the name of the source file __FILE__
  14. Where

    Or here maybe? I've never really used it either but it appears to be good [smile]
  15. openGL problem

    Sorry, I wasn't very clear. I meant to say the *.dll part of the filename, when you browse for an assembly it just shows you any dll file that it finds [smile]