Re: Porting/updating CSBwin for Linux and sound support
Posted: Sun May 22, 2016 7:10 pm
The 'Dungeon Master' video games community
https://www.dungeon-master.com/forum/
Code: Select all
textureRect.x = 0;
textureRect.y = 0;
textureRect.w = width;
textureRect.h = height;
Code: Select all
textureRect.x = dstX;
textureRect.y = dstY;
textureRect.w = width;
textureRect.h = height;
Code: Select all
rendererRect.x = dstX;
rendererRect.y = dstY;
rendererRect.w = width;
rendererRect.h = height;
SDL_RenderCopy(sdlRenderer,
sdlTexture,
&textureRect,
&rendererRect);
Code: Select all
sourceRect.x = 0;
sourceRect.y = 0;
sourceRect.w = 320;
sourceRect.h = 200;
destinationRect.x = 0;
destinationRect.y = 0;
destinationRect.w = 1360;
destinationRect.h = 768;
SDL_RenderCopy(sdlRenderer,
sdlTexture,
&sourceRect,
&destinationRect);
Code: Select all
SDL_RenderCopy(sdlRenderer,
sdlTexture,
NULL,
NULL);
Code: Select all
void UI_SetDIBitsToDevice(
int dstX,
int dstY,
int width,
int height,
int,
int,
int,
int,
char *bitmap,
void *,
int
)
{
/* textureRect is for sdlTexture partial updating ONLY.
* dstX and dstY are the coordinates on which the partial update rect start on sdlTexture,
* so they must be used on textureRect accordingly.
* bitmap pixels are 2bytes each. */
SDL_Rect textureRect;
SDL_Rect rendererRect;
void *dstPixels;
int pitch;
int line;
if (sdlTexture == NULL) return;
textureRect.x = dstX;
textureRect.y = dstY;
textureRect.w = width;
textureRect.h = height;
if (SDL_LockTexture(sdlTexture,
&textureRect,
&dstPixels,
&pitch))
{
UI_MessageBox(SDL_GetError(),
"UI_SetDIBitsToDevice",
MESSAGE_OK);
die(0x53a9);
};
for (line=0; line<height; line++)
{
memcpy((ui8 *)dstPixels+pitch*line,
bitmap+2*320*(line), width*2);
};
SDL_UnlockTexture(sdlTexture);
SDL_RenderClear(sdlRenderer);
SDL_RenderCopy(sdlRenderer,
sdlTexture,
NULL,
NULL);
SDL_RenderPresent(sdlRenderer);
return;
}
I can give you lots of active links. But none is likelycan you give me an active link?
Here is what I tried:the mouse pointer is stuck and reapears on the new positon after a while