本文整理汇总了C++中DisposeGWorld函数的典型用法代码示例。如果您正苦于以下问题:C++ DisposeGWorld函数的具体用法?C++ DisposeGWorld怎么用?C++ DisposeGWorld使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DisposeGWorld函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
~impl() {
if (image_desc) DisposeHandle((Handle)image_desc);
if (handle) DisposeHandle(handle);
if (gworld) DisposeGWorld(gworld);
if (buffer) delete[] buffer;
if (movie) DisposeMovie( movie );
}
示例2: DisposeGWorld
void _HYPlatformGraphicPane::_SetPaneSize (int h,int w, int d)
{
DisposeGWorld (thePane);
Rect bRect;
bRect.left = bRect.top = 0;
bRect.right = w;
bRect.bottom = h;
short errCode;
if (d>1)
{
errCode = NewGWorld (&thePane,d,&bRect,0,GetMainDevice(),noNewDevice);
if (errCode == -108) // no memory
errCode = NewGWorld (&thePane,d,&bRect,0,GetMainDevice(),noNewDevice|useTempMem);
}
else
{
errCode = NewGWorld (&thePane,d,&bRect,0,nil,0);
if (errCode == -108) // no memory
errCode = NewGWorld (&thePane,d,&bRect,0,nil,useTempMem);
}
if (errCode)
{
_String errMsg ("MacOS Error ");
errMsg = errMsg & (long)errCode &" while trying to allocate memory for GraphicPane";
FlagError (errMsg);
}
}
示例3: gst_osx_video_src_stop
static gboolean
gst_osx_video_src_stop (GstBaseSrc * src)
{
GstOSXVideoSrc *self;
ComponentResult err;
self = GST_OSX_VIDEO_SRC (src);
GST_DEBUG_OBJECT (src, "stopping");
self->video_chan = NULL;
err = CloseComponent (self->seq_grab);
if (err != noErr)
GST_WARNING_OBJECT (self, "CloseComponent returned %d", (int) err);
self->seq_grab = NULL;
DisposeGWorld (self->world);
self->world = NULL;
if (self->buffer != NULL) {
gst_buffer_unref (self->buffer);
self->buffer = NULL;
}
return TRUE;
}
示例4: LoadBlastText
OSErr LoadBlastText(BTIPtr theInfo,short theFile,short theResId)
{
GWorldPtr theWorld;
OSErr theErr;
BTEHandle theBits;
theInfo->lCoords=0L;
theInfo->textRec.world=0L;
theBits=(BTEHandle)BetterGetResource(theFile,kBlastTextExtrasResType,theResId);
if (!theBits)
return BetterGetResErr();
theInfo->spaceWidth=(**theBits).spaceWidth;
theInfo->remapMe=(**theBits).remapCol;
theInfo->transp=(**theBits).transpCol;
BetterDisposeHandle((Handle)theBits);
if (theErr=NewGWorldWithPic(&theWorld,theResId,8))
return theErr;
MakeBCRecFromGWorld(theWorld,&theInfo->textRec);
theInfo->lCoords=(Rect**)BetterGetResource(theFile,kLetterCoordResType,theResId);
if (!theInfo->lCoords)
{
DisposeGWorld(theWorld);
return BetterGetResErr();
}
HLock((Handle)theInfo->lCoords);
return noErr;
}
示例5: get_scrap_helper_dib
PUBLIC int
get_scrap_helper_dib (void *vh, void *lp)
{
SDL_Surface *surfp;
GWorldPtr gp;
PicHandle pich;
Handle h;
int retval;
int len;
surfp = surface_from_dib (lp);
gp = gworld_from_surface (surfp);
SDL_FreeSurface (surfp);
pich = pict_from_gworld (gp, &len);
DisposeGWorld (gp);
h = (Handle) vh;
len = GetHandleSize ((Handle) pich);
ReallocHandle (h, len);
if (MemErr != noErr)
retval = -1;
else
{
memcpy (STARH (h), STARH (pich), len);
retval = len;
}
DisposHandle ((Handle) pich);
return retval;
}
示例6: QutTexture_CreateCompressedTextureObjectFromFile
//=============================================================================
// QutTexture_CreateCompressedTextureObjectFromFile : Create a QD3D
// compressed texture.
//-----------------------------------------------------------------------------
TQ3TextureObject
QutTexture_CreateCompressedTextureObjectFromFile(
const FSSpec * theFSSpec,
TQ3PixelType pixelType,
TQ3Boolean wantMipMaps)
{
TQ3TextureObject theTexture = NULL;
GWorldPtr theGWorld = NULL;
PixMapHandle thePixmap = NULL;
// Load the image, then create a texture from it
theGWorld = QutTexture_CreateGWorldFromFile(theFSSpec, pixelType);
if (theGWorld != NULL)
{
thePixmap = GetGWorldPixMap(theGWorld);
if( thePixmap != NULL)
{
theTexture = QutTexture_CreateCompressedTextureObjectFromPixmap(thePixmap, pixelType, wantMipMaps);
DisposeGWorld(theGWorld);
}
}
return(theTexture);
}
示例7: createOffscreen
void createOffscreen(int pictItem)
{
PicHandle pict;
Rect rect;
CGrafPtr currentPort;
GDHandle currentDevice;
if (gGWorld != nil)
DisposeGWorld( gGWorld );
pict = (PicHandle)GetResource( 'PICT', pictItem + 127 );
rect = (**pict).picFrame;
GetGWorld( ¤tPort, ¤tDevice );
NewGWorld( &gGWorld, 32, &rect, nil, nil, 0 );
LockPixels( GetPortPixMap(gGWorld));
SetGWorld( gGWorld, nil );
DrawPicture( pict, &rect );
SetGWorld( currentPort, currentDevice );
ReleaseResource( (Handle)pict );
}
示例8: StopMovie
////////////////////////////////////////////////////////////////////////////////
// private
bool LLMediaImplQuickTime::unload()
{
if ( mMovieHandle )
{
StopMovie( mMovieHandle );
if ( mMovieController )
{
MCMovieChanged( mMovieController, mMovieHandle );
};
};
if ( mMovieController )
{
MCSetActionFilterWithRefCon( mMovieController, NULL, (long)this );
DisposeMovieController( mMovieController );
mMovieController = NULL;
};
if ( mMovieHandle )
{
SetMovieDrawingCompleteProc( mMovieHandle, movieDrawingCallWhenChanged, nil, ( long )this );
DisposeMovie ( mMovieHandle );
mMovieHandle = NULL;
};
if ( mGWorldHandle )
{
DisposeGWorld( mGWorldHandle );
mGWorldHandle = NULL;
};
return true;
}
示例9: put_scrap_helper_dib
PUBLIC void
put_scrap_helper_dib (void *lp)
{
PicHandle pich;
pich = pict_from_lp (lp);
if (pich)
{
GWorldPtr gp;
gp = gworld_from_pict (pich);
if (gp)
{
SDL_Surface *surfp;
surfp = surface_from_gworld (gp);
if (surfp)
{
write_surfp_to_clipboard (surfp);
SDL_FreeSurface (surfp);
}
DisposeGWorld (gp);
}
DisposHandle ((Handle) pich);
}
}
示例10: MyDisposeEverything
void MyDisposeEverything (void)
{
short nIndex;
// dispose of each spriteÕs image data
for (nIndex = 0; nIndex < kNumSprites; nIndex++)
{
if (gSprites[nIndex])
DisposeSprite(gSprites[nIndex]);
if (gCompressedPictures[nIndex])
DisposeHandle(gCompressedPictures[nIndex]);
if (gImageDescriptions[nIndex])
DisposeHandle((Handle)gImageDescriptions[nIndex]);
}
// dispose of the sprite plane world
if (gSpritePlane)
DisposeGWorld(gSpritePlane);
// dispose of the sprite world and associated graphics world
if (gSpriteWorld)
DisposeSpriteWorld(gSpriteWorld);
}
示例11: ROM_UnsetVideoMode
static void ROM_UnsetVideoMode(_THIS, SDL_Surface *current)
{
/* Free the current window, if any */
if ( SDL_Window != nil ) {
GWorldPtr memworld;
/* Handle OpenGL support */
Mac_GL_Quit(this);
memworld = (GWorldPtr)GetWRefCon(SDL_Window);
if ( memworld != nil ) {
UnlockPixels(GetGWorldPixMap(memworld));
DisposeGWorld(memworld);
}
if ( (current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
#if USE_QUICKTIME
EndFullScreen(fullscreen_ctx, nil);
SDL_Window = nil;
#else
ROM_ShowMenuBar(this);
#endif
}
}
current->pixels = NULL;
current->flags &= ~(SDL_HWSURFACE|SDL_FULLSCREEN);
}
示例12: closeMovie
//---------------------------------------------------------------------------
ofVideoPlayer::~ofVideoPlayer(){
//--------------------------------------
#ifdef OF_VIDEO_PLAYER_QUICKTIME
//--------------------------------------
closeMovie();
if(allocated) delete(pixels);
if(allocated) delete(offscreenGWorldPixels);
if(allocated && (offscreenGWorld)) DisposeGWorld((offscreenGWorld));
//--------------------------------------
#else
//--------------------------------------
// [CHECK] anything else necessary for FOBS ? please check
if (fobsDecoder != NULL){
delete fobsDecoder;
}
if (pixels != NULL){
delete pixels;
}
//--------------------------------------
#endif
//--------------------------------------
tex.clear();
}
示例13: EndMediaEdits
void MovieMaker::EndCapture()
{
OSStatus error = noErr;
if (movie && movieResRef)
{
if (media && track)
{
// Errors adding the frame aren't too important here.
(void)addFrame();
error = EndMediaEdits(media);
if (error == noErr)
{
error = SCCompressSequenceEnd(ci);
}
if (error == noErr)
{
error = InsertMediaIntoTrack(track, 0, 0, GetMediaDuration(media), fixed1);
}
media = NULL;
track = NULL;
}
short resId = movieInDataForkResID;
error = AddMovieResource(movie, movieResRef, &resId, "\pSecond Life");
CloseMovieFile(movieResRef);
movieResRef = 0;
movie = NULL;
}
// NOTE: idh is disposed by SCCompressSequenceEnd.
idh = NULL;
if(ci)
{
CloseComponent(ci);
ci = NULL;
}
if(gworld)
{
DisposeGWorld(gworld);
gworld = NULL;
}
if(buffer)
{
free(buffer);
buffer = NULL;
}
if(invertedBuffer)
{
free(invertedBuffer);
invertedBuffer = NULL;
}
}
示例14: QTCode_DoDestroyOffscreen
void QTCode_DoDestroyOffscreen(GWorldPtr offscreen, HBITMAP hBitmap)
{
BOOL success;
/* Destroy the offscreen GWorld and related objects */
DisposeGWorld(offscreen);
success = DeleteObject(hBitmap);
}
示例15: CloseTintWorld
void CloseTintWorld()
{
if(gBL_TintWorld)
{
DisposeGWorld(gBL_TintWorld);
gBL_TintWorld=0L;
}
}