Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can not build Alpha surface with DirectDraw

Posted on 2001-06-11
3
Medium Priority
?
755 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

704 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