View Single Post
Old 22 April 2013, 03:12   #89
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,719
This is using the CyberGFX API.

declarations:
Code:
#include <cybergraphics.h>
#include <inline/cybergraphics.h>

struct Library *CyberGfxBase;

UBYTE *chunkyBackBuffer // your chunky back pixel data!

Setup stuff:
Code:
    CyberGfxBase = OpenLibrary ("cybergraphics.library", 0);
	if (CyberGfxBase == NULL) {
		error("Cannot open cybergraphics.library");
	}

Update screen:
Code:
UBYTE *baseAddress;
APTR  bitmapHandle;



bitmapHandle = LockBitMapTags(_hardwareScreen->ViewPort.RasInfo->BitMap,
									LBMI_BASEADDRESS, (ULONG)&baseAddress,
									TAG_DONE);

if (bitmapHandle) {
	CopyMemQuick(chunkyBackBuffer, baseAddress, _videoMode.screenWidth * _videoMode.screenHeight);

	UnLockBitMap(bitmapHandle);
}

clean up:
Code:
    if (CyberGfxBase) {
		CloseLibrary (CyberGfxBase);
		CyberGfxBase = NULL;
	}
Attached Files
File Type: c refresh.c (7.3 KB, 171 views)

Last edited by NovaCoder; 08 July 2013 at 07:33.
NovaCoder is offline  
 
Page generated in 0.04185 seconds with 12 queries