• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Lafo

Directx Blitting Problem form a Beginner

2 posts in this topic

Well, your code looks good, but there is a little problem : in the main loop (after the while (1) {...) you have to blt the image in each frame, like this :
while(1)
{

hr = g_pDDS->Blt(&rectDest, g_pVaisseau, &rectSrc, DDBLT_WAIT,NULL);

and so on
}
Now, you could say : "Why?". The key is inside the Flip Method. When you call it, the Video Board "exchanges" the primary surface with the secondary surface. In fact, it thinks the primary surface is the secondary, and vice versa. This will happen each time you call Flip.

Good luck....

0

Share this post


Link to post
Share on other sites
well actually the guy who posted before me is correct in the fact that you need to blit each loop.. but if you Blit once it should still give you a flicker of the blitted bmp in video memory so you would see something..dirty memory.. but it would still be the bmp if it was blitted.

It sounds almost like your BMP isn't loading correctly.
Check the return codes from the ddutil routine that loads your bitmap.
It's been awhile..but make sure you created a surface for that bmp to be loaded into. I remember some routines in ddutil.cpp used to create surfaces on the fly.. but you might want to make your own and see if you can load the bmp into it.

So..
1: Check your return codes (no matter what dx routine)
2: Make sure your bmp exists... if stored in a directory like c:\pix\pix.bmp.. you would say c:\\pix\\pix.bmp when loading.
3: Make sure you have enough video mem. maybe the surface is trying to create in vid ram.. and you are set at 1280x1024 24 bit color and you have a 2 meg vid card with double buffer active. You probably wont be able to load the bmp at that point.
4: always blit through a loop... do your flips... and umm.. maybe clear the display before a blit to see if anything shows up.. But I recommend that you take off clearing the display each loop ( that will slow yah down..unless you are doing dirty rects routines)

Latez bro,
DL

0

Share this post


Link to post
Share on other sites
Hi, I'm creating my first directX application
and I'm having problems blitting. I'm using ddutil.cpp that comes with directx 6.1.

Here is a part of my code:

void Game_Init(void)
{
g_pVaisseau = DDLoadBitmap(g_pDD, "vaisseau.bmp",0,0);
ShowCursor(0);

}

void Game_Main(void)
{
HRESULT hr;

RECT rectSrc, rectDest;
rectSrc.left = rectSrc.top = 0;
rectDest.left = rectSrc.top = 0;
rectSrc.right = rectSrc.bottom = 150;
rectDest.right = rectDest.bottom = 150;

hr = g_pDDS->Blt(&rectDest, g_pVaisseau, &rectSrc, DDBLT_WAIT,NULL);

while(1)
{
hr = g_pDDS->Flip(NULL, 0);
if (hr == DD_OK)
break;
if (hr = DDERR_SURFACELOST)
{
hr= g_pDDS->Restore();
if (FAILED(hr))
break;
}
if (hr != DDERR_WASSTILLDRAWING)
break;
}

}

My program start without problem, but nothing is drawn to the screen. My application quit normally when I press ESC which means the prog isn't freeze.

Know my problem?

0

Share this post


Link to post
Share on other sites