direct draw basics...need some help

This is a discussion on direct draw basics...need some help within the Game Programming forums, part of the General Programming Boards category; alright, i finally decided to seriously take on directx. anyways, i am trying to just set up a basic window ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    106

    direct draw basics...need some help

    alright, i finally decided to seriously take on directx. anyways, i am trying to just set up a basic window (i'm not trying to create any surfaces yet or anything). heres the coding im having trouble with:

    Code:
    lpdd->QueryInterface(IID_IDirectDraw4,(LPVOID *)&lpdd4)
    i'm using msvc++ 6.0, and the error i get is:
    error C2065: 'IID_IDirectDraw4' : undeclared identifier

    and this is killing me. ive got everything i need, or so i think. ive created the lpdd and lpdd4 objects, ive included the ddraw.lib and ddraw.h in my project. if anyone could help, i would really really appreciate it. thanks alot.

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Your function should compile, but won't link if you haven't linked to dxguid.lib. What version of the DX sdk do you have ? The code below compiles and links -

    Code:
    #pragma comment(lib,"ddraw.lib")
    #pragma comment(lib,"dxguid.lib")
    
    #include <ddraw.h>
    
    
    LPDIRECTDRAW lpDD;
    LPDIRECTDRAW4 lpDD4;
    int main(){
    
    	DirectDrawCreate(0,&lpDD,NULL);
    	lpDD->QueryInterface(IID_IDirectDraw4,(LPVOID*)&lpDD4);
    
    	lpDD->Release();
    	//Do stuff 
    	lpDD4->Release();
    	
    
    	return 0;
    }
    Also, you may want ditch whatever you're learning this from for something more up to date, as the later versions of Direct X provide an easier method to obtain the correct interface (even though this way should still work).

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    ugh...none of its working...i linked to the dxguid.lib library...everything. this is so aggrivating..anyways thanks for your help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Direct Draw Question
    By cfrost in forum Game Programming
    Replies: 1
    Last Post: 09-24-2004, 05:01 PM
  2. Direct Draw: Rotating a bitmap
    By Diamonds in forum Game Programming
    Replies: 6
    Last Post: 09-08-2003, 02:36 PM
  3. Direct Draw 7 and Sprites
    By Zoalord in forum Game Programming
    Replies: 1
    Last Post: 08-13-2003, 01:10 PM
  4. Direct Draw weird stuff
    By Magos in forum C++ Programming
    Replies: 6
    Last Post: 04-24-2002, 05:39 AM
  5. Direct Draw problem
    By morbuz in forum Game Programming
    Replies: 5
    Last Post: 10-08-2001, 07:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21