Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Just needing a straight answer...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 January 2000 - 07:14 AM

I have posted this before but the replies weren''t satisfying enough. I just need a straight answer. How can you get a pointer to the backsurface? All things have been done (like creating the directdraw object and stuff). Fill in the dots. backbufferptr=(unsigned char *)...

Sponsor:

#2 Jim Adams   Members   -  Reputation: 440

Like
Likes
Like

Posted 07 January 2000 - 07:26 AM

The prior answers were correct. Once you have the initialized DirectDraw surface interface object for the backbuffer, you simply lock it, then use the lpsurface pointer retrieved from the description structure you passed to the lock function. Refer to the SDK on locking surfaces for the exact method of doing this.

If that''s not the answer you need, please explain exactly what you are trying to do -- maybe your question isn''t correct (the terms you are using).



Jim Adams
Game-Designer/Author
tcm@pobox.com
http://www.lightbefallen.com
http://www.basicelectronics.com


#3 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 January 2000 - 08:49 AM

Now I get it! (i hope) Tell me if this is the right way:

{
lpDDSBack->Lock(NULL,&ddsurfacedesc,DDLOCK_WAIT,NULL);
backbuffer=(unsigned short *)ddsurfacedesc.lpSurface;
};

Thanx for your patience.

#4 acw83   Members   -  Reputation: 174

Like
Likes
Like

Posted 07 January 2000 - 09:20 AM

I think this would work too:

backbuffer = lpDDSBack->Lock(NULL,&ddsurfacedesc,DDLOCK_WAIT,NULL);


#5 Chappa   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 January 2000 - 10:50 AM

No, this won''t work.
IDIRECTDRAWSURFACE->Lock doesn''t return the pointer to the surface but a return value of type HRESULT (error code).
And bosjoh, you got it! That''s the one and only way to do it. And please don''t forget to unlock the surface after you''re done.

Correct me if I''m wrong.

#6 NuFAN   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 January 2000 - 08:12 PM

Hi,
sure that this will work ? I thought you''d have to pass DDLOCK_SURFACEMEMORYPTR to the Lock() function like this :


lpDDSBack->Lock(NULL, &ddsd, DDLOCK_WAIT / DDLOCK_SURFACEMEMORYPTR, NULL);
USHORT* buffer = (USHORT*)ddsd.lpSurface;


CU

Graphix Coding @
Skullpture Entertainment

#7 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 January 2000 - 02:07 AM

Only passing DDLOCK_WAIT works fine for me...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS