Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can not build Alpha surface with DirectDraw

Posted on 2001-06-11
3
Medium Priority
?
761 Views
Last Modified: 2007-12-19
Colleagues,

When I'm creating an alpha surface with this code:

     LPDIRECTDRAWSURFACE lpAlphaSrfc;
     DDSURFACEDESC ddsdA;
     memset(&ddsdA, 0, sizeof(ddsdA));
     ddsdA.dwSize = sizeof(ddsdA);
     ddsdA.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_ALPHABITDEPTH;
     ddsdA.ddsCaps.dwCaps = DDSCAPS_ALPHA | DDSCAPS_OFFSCREENPLAIN;
     ddsdA.dwHeight = cursor.GetHeight();
     ddsdA.dwWidth = cursor.GetWidth();
     ddsdA.dwAlphaBitDepth = 8;

     HRESULT hr = lpDirectDrawObject->CreateSurface(&ddsdA, &lpAlphaSrfc, NULL);

I'm getting DDERR_INVALIDPARAMS. Can any one tell me, what's missing?

Thank you,
Nick
0
Comment
Question by:kender_a
3 Comments
 

Accepted Solution

by:
GuyJohnston earned 200 total points
ID: 6274646
What version of Direct X are you using ?
Try inserting version numbers at the end of the
prototypes.
    /////////
    LPDIRECTDRAWSURFACE4 lpAlphaSrfc4; // 4 here
    DDSURFACEDESC2 ddsdA;              // 2 here
    /////////    
   memset(&ddsdA, 0, sizeof(ddsdA));
    ddsdA.dwSize = sizeof(ddsdA);
    ddsdA.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_ALPHABITDEPTH;
    ddsdA.ddsCaps.dwCaps = DDSCAPS_ALPHA | DDSCAPS_OFFSCREENPLAIN;
    ddsdA.dwHeight = cursor.GetHeight();
    ddsdA.dwWidth = cursor.GetWidth();
    ddsdA.dwAlphaBitDepth = 8;
    ////////
    HRESULT hr = lpDirectDrawObject->CreateSurface(&ddsdA, &lpAlphaSrfc4, NULL); // 4 here
    ///////
Errors could arise if correct version is not used.

0
 
LVL 11

Expert Comment

by:griessh
ID: 6814571
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "GuyJohnston" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Please do not accept this comment as an answer!
======
Werner
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6833239
Per recommendation comment force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question