📄 graf2.c
字号:
/*************************************************************************/
/* */
/* Copyright (c) 1997 - 1999 Accelerated Technology, Inc. */
/* */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
/* subject matter of this material. All manufacturing, reproduction, */
/* use, and sales rights pertaining to this subject matter are governed */
/* by the license agreement. The recipient of this software implicitly */
/* accepts the terms of the license. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* GRAF2.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the GrafQueue and GrafPool functions. */
/* */
/* AUTHOR */
/* */
/* Robert G. Burrill, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
#include "meta_wnd.h"
#include "metconst.h" /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h" /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"
/* Local functions */
void GrafFree(void *freePtr);
point *GrafAlloc(int memSize);
/* Function GrafQueue sets the size (in event queue elements) that will be
allocated for the event queue if/when it is enabled. */
void GrafQueue(int argMSGCNT)
{
q_Size = argMSGCNT;
return;
}
/* Function GrafPool sets the size (in bytes) that will be allocated for
the memory pool upon the InitGraphics() call, or if already allocated,
frees the current pool and allocates a new one of requested size. */
int GrafPool (unsigned argPOOLSIZE)
{
short grafErrValue;
if (gFlags & gfGrafInit) /* have we already InitGraphics()'d ? */
{ /* yes, re-allocate the pool */
GrafFree(mpWorkSpace); /* free current pool memory */
mpWorkSpace = (byte *) GrafAlloc(argPOOLSIZE); /* allocate new pool memory */
if (mpWorkSpace == NULL)
{ /* can't allocate it */
grafErrValue = c_GrafPool + c_OutofMem;
nuGrafErr(grafErrValue);
return(-1);
}
mpWorkEnd = (byte *)((unsigned)mpWorkSpace + argPOOLSIZE);
}
/* no, set the pool size to allocate */
mpSize = argPOOLSIZE;
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -