Results 1 to 13 of 13

Thread: Surface width problem (DirectDraw7)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421

    Surface width problem (DirectDraw7)

    Why is it that I can't make a surface any wider than my screen resolution but I can make it as tall as I want? I'm still working on this $#@^ing map editor and it flickers like all hell but I'm sure I'll figure it out. Anyways, if you know what's goin on with the width problem, let me know, thanks.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Try storing the surface explicitly in Virtual memory. If it works, then make it smaller, because your Graphics Card can't handle those surfaces. Virtual Memory is using your HDD as memory.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Ok, then how can I stop the stretching when I blt the BackBuffer to the Primary surface?
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Stretching??

    Look at the rects. Make sure they are the same when Left is taken away from Right and Top from Bottom. That'll let you know if YOU are doing the stretching.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    I guess you're drawing the whole map to a huge surface, then draw a part of it on the screen? Damn, that'll take up quite some memory when the maps get larger.... try using something more intelligent.

    The easiest way is to simply re-draw each tile each iteration, not very intelligent though, but it works. The faster (but more difficult) way could be to pre-draw only a portion of the map (slightly larger than the screen maybe, or exactly the size preferably), move the whole thing if the screen moves and draw any new tiles needed at the edges only; drawing one large rectangle is faster than drawing a lot of small ones...



    About the width: yes, there's a maximum. Most of the time, surfaces wider than the screen can not be used...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421

    Question

    It can't be wider even if it's a BackBuffer?
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  7. #7
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Nope. Why would you need a backbuffer larger than the screen area anyways, with some clever programming you can optimize speed and memory usage, without having those problems...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Yeah I got something figured out now. The problem is getting it to work right, it's gonna take some time. Also, anyone know how I can "Lock" a surface so I don't have to keep redrawing it? I know there's a .Lock action but that's not what I want to do. A good example of the kind of map editor I'm trying to make is the one for WarCraft II BNE. The problem is, when the I move a 32x32 shape around so the user knows where their next tile will be placed, it goes under the primary surface and flickers while you move it around. Hopefully, not having to redraw the surface constantly will help. Thanks.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  9. #9
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    First of all, never draw directly to the front surface unless it's for drawing the backbuffer to it (which you won't need, that's what Flip is for ).

    If you want to save what's on the screen, create another surface, store the screen there, and draw the rectangle over that. Locking it won't work as far as I know, you'll need to redraw it at least every time Windows asks for it or the user moves...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    I'm not drawing directly to the primary surface. When I get home, I'll post up my project so you can see what my problem is. You should be able to tell right away. Thanks for helpin.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421

    Arrow

    Ok here it is, please let me know if you can "lock" the surface so that when you move the mini map around, it doesn't erase the part of the surface it goes over. There's a few more things, just help with what you can, please. Thanks.
    Attached Files Attached Files
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  12. #12
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    Haven't looked at your project.

    heres a quick example i made for a lecturer, of a window'ed tile engine, its rather simple, and theres a slight problem with the bottom right clipping.

    it also runs through each tile rather than just the tiles that are on the screen.
    Attached Files Attached Files
    Some Days, i just get this feeling that i'm helping to write dozens of Viruses...

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Thanks man, that's exactly what I was looking for. If I had a hundred bucks, I would give it to you. Thanks again.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width