void draw_tiles(void)
{
int tile;
int x;
int y;
RECT tile_src;
for (x = 0; x < WORLD_SIZEX; x++)
{
for (y = 0; y < WORLD_SIZEY; y++)
{
tile = map[x][y]; // tile now stores the ID of this particular tile
tile_src.left = (tile - 1) * TILE_SIZE;
tile_src.top = 0;
tile_src.right = tile * TILE_SIZE;
tile_src.bottom = TILE_SIZE;
BltFast(x * TILE_SIZE, y * TILE_SIZE, lpDDSBack, &tile_src, NULL);
}
}
}
Now, I have ddraw.lib, dxguid.lib included in the projects lib and I also include ddraw.h in the required files. Can anybody tell me what I''m doing wrong. I need this ASAP.
Thanks
Cyberdrek
Headhunter Soft
DLC Multimedia
Problems with BltFast....
Ok, as the title mentions, I''m having a little problem with BltFast(...). When ever I try to use the function, I get this error:
d:\PROJECTS\tkl\tiles.cpp(40) : error C2065: ''BltFast'' : undeclared identifier
Here is what the code looks like... At least the function that uses BltFast.
[Cyberdrek | ]
BltFast is a member of a IDirectDrawSurface7 interface. So you must use something like this:
lpDDSBack->BltFast(x * TILE_SIZE, y * TILE_SIZE, lpDDS_tile, &tile_src, NULL);
By the way, the third parameter is the source surface, not the destination. If you want to use the whole source surface, you can pass NULL as the fourth parameter.
alexk7@ivic.qc.ca
http://www.ivic.qc.ca/~alexk7/
lpDDSBack->BltFast(x * TILE_SIZE, y * TILE_SIZE, lpDDS_tile, &tile_src, NULL);
By the way, the third parameter is the source surface, not the destination. If you want to use the whole source surface, you can pass NULL as the fourth parameter.
alexk7@ivic.qc.ca
http://www.ivic.qc.ca/~alexk7/
alexk7
quote:
BltFast is a member of a IDirectDrawSurface7 interface. So you must use something like this:
lpDDSBack->BltFast(x * TILE_SIZE, y * TILE_SIZE, lpDDS_tile, &tile_src, NULL);
By the way, the third parameter is the source surface, not the destination. If you want to use the whole source surface, you can pass NULL as the fourth parameter.
Thanks for the answer. BTW, I was actually trying to Blit the backbuffer to the primary buffer. I know I should use a flip method but I''m just doing it as a test. Anyhow, your help did work and I am verry gratefull.
Cyberdrek
Headhunter Soft
DLC Multimedia
[Cyberdrek | ]
If your using tiles, why not support windowed mode?
I find windowed mode for tile based games great, you can use ICQ, and other apps while playing, and it''s not hard to keep both fullscreen and windowed modes in your tile based games.
Take a look at the directX code samples (switcher example source)
Darrell
Tile Studio
I find windowed mode for tile based games great, you can use ICQ, and other apps while playing, and it''s not hard to keep both fullscreen and windowed modes in your tile based games.
Take a look at the directX code samples (switcher example source)
Darrell
Tile Studio
The reason why I''m exclusively in full screen is that I''m used to playing my games in full screen and I find the clipping easier to do as most of the time, none is required. I will none the less keep your suggestion in mind for later..
Cyberdrek
Headhunter Soft
DLC Multimedia
Cyberdrek
Headhunter Soft
DLC Multimedia
[Cyberdrek | ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement