Catwheel

Members
  • Content count

    13
  • Joined

  • Last visited

Community Reputation

125 Neutral

About Catwheel

  • Rank
    Member
  1.   I'm not exactly sure what the inflection is here. Are you saying this is too early for a programmer to learn graphics programming or too late, or are you stated that I am currently getting experience? I don't mean to sound condescending I'm just wondering what you meant and where that means I am now (I.E. ahead of the curve, behind, doesn't matter where)     I have been using visual c++ 2008 express edition. It was recommended by my client, because it can compile the byte code within 1KB. I do have Visual studio somewhere on this computer and I think that it is a full version (because I'm a student). I guess I should be giving that a try? I will try it.       If the app has a console window (which it should, if it doesn't), std::cout ( or printf() ) would work. Or launch the app from a cmd window. Otherwise, take a look at OutputDebugString(). The latter outputs c-strings, which requires you to format your output string if you want to output numbers. Again, if you're not launching it from Visual Studio, you'll have to find a debug message monitor like debugview. For clarity's sake let me say that back as I understood it to make sure I have it right. If I use Visual Studio it should give me a debug message monitor. How do I access this monitor? Do I need to do anything special with my .dll file? I really have no idea how to test it, except to build it and launch the main app, and then use the plugin to see what happens. An alternative quicker or more custom-message-friendly testing method would be showered with my love.   EDIT: What did you think of my process I outlined in my previous post? Did it look appropriate?
  2. So I'm adding on to my previous post and giving this a bump since I'm still working on this. It looks like, although the draw calls are directly to screen space, they do specify a z value. Would this mean that I could simply enable the depth buffer and it will draw onto the depth buffer the same time that it draws onto the render target? It sounds like a no-brainer, but I still want to ask the community here.
  3. OKay so let me get this straight before I get started. The process should look like this: m_lpDX->m_lpDevice->EndScene(); IDirect3DSurface9 * frame1 = NULL; IDirect3DSurface9 * frame2 = NULL; IDirect3DSurface9 * pBackBuffer = NULL; IDirect3DSurface9 * pActualBackBuffer = NULL; RECT r1; SetRect(&r1, 0, GetHeight()/4, GetWidth(), ((GetHeight()*3)/4)); //get back buffer and initialize frame surfaces m_lpDX->m_lpDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer ); m_lpDX->m_lpDevice->GetRenderTargetData(pBackBuffer,pActualBackBuffer); m_lpDX->m_lpDevice->CreateOffscreenPlainSurface(GetWidth(),GetHeight()/2,D3DFMT_/*format matching back buffer*/,D3DPOOL_DEFAULT,&frame1,NULL);// - CAT m_lpDX->m_lpDevice->CreateOffscreenPlainSurface(GetWidth(),GetHeight()/2,D3DFMT_/*format matching back buffer*/,D3DPOOL_DEFAULT,&frame2,NULL);// - CAT //copy middle of back buffer to the two surfaces m_lpDX->m_lpDevice->StretchRect(pActualBackBuffer,&r1,frame1,NULL,D3DTEXF_NONE); m_lpDX->m_lpDevice->StretchRect(pActualBackBuffer,&r1,frame2,NULL,D3DTEXF_NONE); //some operations would go here later to modify the surfaces for a left and right eye view //copy frame surfaces back to the back buffer to be presented later. RECT d1; SetRect(&d1, 0, 0, GetWidth(), GetHeight()/2); m_lpDX->m_lpDevice->StretchRect(frame1,NULL,pActualBackBuffer,&d1,D3DTEXF_NONE); RECT d2; SetRect(&d2, 0, GetHeight()/2, GetWidth(), GetHeight()); m_lpDX->m_lpDevice->StretchRect(frame2,NULL,pActualBackBuffer,&d2,D3DTEXF_NONE); //release pointers frame1->Release(); frame2->Release(); pBackBuffer->Release(); pActualBackBuffer->Release(); You'll notice that I did not check for the HResults, that is because I have a different question having to do with those before I write them in.   So I checked out the article that Unbird linked. I opened up the directx control panel and set it up for debug mode, however nothing came out. After googling I found that I needed to declare     #define D3D_DEBUG_INFO  so I did that, in this fashion: //#ifdef _DEBUG #define D3D_DEBUG_INFO // declare this before including d3d9.h //#endif #include <d3d9.h> #include <d3dx9.h> I'm not really sure where I'm supposed to retrieve the debug info though. Alternatively, I would settle for just being able to output some info, like with println(); but the program I am altering simply becomes a plugin for another piece of software. Therefore, i don't know where to find the output. I don't have a lot of experience with the command line, but I am wondering "Is there something there I could do?" EDIT: This has to do with my question about HRESULT, which is essentially, "How can I make some custom text output that I can reference, while in this plugin?"   Lastly, I just wanted to say, I'm a senior college student with no prior graphics programming experience. Is this project too demanding for someone from my position? Further, do you have any general advice for someone in my position?
  4. I'm pretty new to direct x, if you've seen my other posts, you probably know that. I'm trying to copy the middle section of the back buffer to a different surface and then copy that back to the top half of the back buffer. My plan later on is to do this twice, copying the back buffer to 2 different surfaces, then modifying those surfaces, and finally copying them back to the back buffer in a sort of splitscreen fashion (so that one surface copies to the top half of the back buffer, and the other surface copies to the bottom half of the back buffer).   Here's my code, which seems pretty sound to me: //rendering stuff m_lpDX->m_lpDevice->EndScene(); IDirect3DSurface9 * frame1 = NULL; IDirect3DSurface9 * pBackBuffer = NULL; RECT r1; SetRect(&r1, GetHeight()/4, 0, GetWidth(), ((GetHeight()*3)/4)-1); m_lpDX->m_lpDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer ); m_lpDX->m_lpDevice->CreateOffscreenPlainSurface(GetWidth(),GetHeight()/2,D3DFMT_X8R8G8B8,D3DPOOL_DEFAULT,&frame1,NULL);// - CAT D3DLOCKED_RECT frame1Lock; D3DLOCKED_RECT pBackBufferLock; frame1->LockRect(&frame1Lock,NULL,NULL); pBackBuffer->LockRect(&pBackBufferLock,NULL,NULL); m_lpDX->m_lpDevice->UpdateSurface(pBackBuffer,&r1,frame1,NULL); r1.top = 0; r1.left = 0; m_lpDX->m_lpDevice->UpdateSurface(frame1,&r1,pBackBuffer,NULL); frame1->UnlockRect(); pBackBuffer->UnlockRect(); frame1->Release(); pBackBuffer->Release(); Trouble is, nothing changes. The regular back buffer still shows. Does anyone have any trouble shooting ideas?  
  5. So I have a program that draws to screen space. I would like to set up a depth buffer and draw and manage it myself. However, I am very unfamiliar with depth buffers and I'm not really sure how you can simply draw and manage it yourself. Essentially, what I want to do, is take any call to drawprimitiveup on the back buffer, and make a similar call to the depth buffer, but have it simply say that the shape is as close as possible to the view. I also do not want it to clear the depth buffer, but rather degregate the vertexes in the depth buffer so that they are slightly further away.   Note: I plan to later use this depth buffer to create a left and right view of the image. I would rather do it in this manner than simply rendering the scene twice, because this method is more desirable for my project.   Any advice on how to bring this concept to practice would be appreciated, as well as references for depth buffer usage, besides just the pipeline doc, or just useful tidbits that I might be able to put together (for example, I am wondering if a depth buffer can be considered a surface in the same way as any other buffer). I'm very new to DirectX so you're advice is appreciated!   -Thanks!   Edit: Some other questions I have: Is it possible to look at the backbuffer and "move" each pixel based on it's depth value? If so, what are the calls for that?
  6. Hey so I need to learn some directX9, more specifically Direct3D9 but I have no experience with graphics programming. I have some general programming experience and I'm pretty decent at it. The other thing is that I am working on a project that uses direct3D9, which is why I need to learn it. It doesn't require a TON of work, but I need to have it finished in two weeks. So, understanding that situation, what are the best tutorials for me to get started with direct3D9.
  7. Thanks Buckeye! I think I'm gonna have to sit down and do some direct3D tutorials. I was hoping to avoid it to save time but now it seems like I've just wasted a bunch of time. To make sure I have you correctly though, each view port has to be presented while it is set and after it has done it's scene? So you're saying you cannot render both scenes for both viewports and then draw them in one call of present? Just to make sure I have that right. Also, any idea why fullscreen is only showing the results for one present call? This program is pretty big so it's easy for something to happen with out my knowing.
  8. okay so... some new issues. I've got the screen displaying the same image twice, which is good. For some reason I can't get the viewports to work correctly. I've looked at the example linked by unbird for view ports and I just cannot figure out how they get it so that when it presents it show the split screen image. It only seems to show the single image for me. now I can't show my code because it is place around a bunch of long and expansive code but basically it's like this:   some other part of the frame work calls beginscene then it calls my function   for(2 times) {      function does all the drawing stuff        endscene()      setViewport(second viewport)      beginscene() } setViewport(first viewport) beginscene()   function ends the frame work later calls endscene()   lastly, the framework presents the image. I have altered it so that it presents the same image twice one over the other.   any advice? I know this is very sloppy but I've been at my wits end trying to do all of this. I just learned c++ and I'm sick now. Client has stopped bothering me since I've been e-mailing him daily progress. I'm thinking that if I can make a sloppy prototype of something that works, then I can redo a clean version of it, but I need something that works first. Anyways.   The second issue I am having is that when i enter fullscreen mode, the screen goes back to just one screen and with no split screen. I imagine this will fix when I can get the viewports setup. Any advice is appreciated!
  9. so I edited the viewport for the system, and then all the 3d objects went away, but the 2D objects written from drawprimitiveup were still there. After that I messed with it some more and now everything is displaying back to normal, but what's weird is I have the system set up to display 2 viewports? Why is there no change? here's the code. any theories? void DXContext::SetViewport() { D3DVIEWPORT9 v; v.X = 0; v.Y = 0; v.Width = m_client_width; v.Height = m_client_height/2; v.MinZ = 0.0f; v.MaxZ = 1.0f; m_lpDevice->SetViewport(&v); D3DVIEWPORT9 v2; v2.X = 0; v2.Y = m_client_height/2; v2.Width = m_client_width; v2.Height = m_client_height/2; v2.MinZ = 0.0f; v2.MaxZ = 1.0f; m_lpDevice->SetViewport(&v2); } Going to get back at it tomorrow. let me know if you know anything I can use here. so sleepy
  10. awesome! thanks!
  11. Is directx9 and direct3D9 the same thing? if not, what is the difference?
  12. thank you! you are like an angle bird from on high! (no idea how to say that)
  13. I recently got my first ever freelance job (or programming job in general for that matter) and I need to rewrite an old plugin for winamp to have two splitscreens, each screen rendering with slightly altered input to create a fake stereoscopic effect. now I've been searching around for a few hours, and I have found some tutorials about directx9 but none of them cover how to create a split screen in C++ (which I learned a few days ago). I think I'm kinda locked into using this old version of directx and I have not been able to find the original documentation on the framework. I'm looking for advice or sources of good information about this subject. At the point I'm at I usually post on a relevant forum and take a break. My first employer has been razzing me about getting as much work done as possible, and I am currently feeling exhausted. I guess that's not super relevant to readers of this, but any helpful advice, or links to useful material would be greatly appreciated. Thanks! If you need any more information please let me know!