本文整理汇总了C++中Dispose函数的典型用法代码示例。如果您正苦于以下问题:C++ Dispose函数的具体用法?C++ Dispose怎么用?C++ Dispose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Dispose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dispose
TextureCollection::~TextureCollection()
{
Dispose(false);
}
示例2: Dispose
CDVDOverlayCodecFFmpeg::~CDVDOverlayCodecFFmpeg()
{
Dispose();
}
示例3: Dispose
CDVDVideoCodecOpenMax::~CDVDVideoCodecOpenMax()
{
Dispose();
}
示例4: Dispose
CDVDDemuxPVRClient::~CDVDDemuxPVRClient()
{
Dispose();
}
示例5: Dispose
void Game_Map::Quit() {
Dispose();
interpreter.reset();
}
示例6: Dispose
KinectThread::~KinectThread() {
Dispose();
}
示例7: Dispose
Mover_c::~Mover_c()
{
Dispose ();
}
示例8: Dispose
UserTable::~UserTable()
{
Dispose();
}
示例9: HDumpGraf
/* EXPORT->HDumpGraf: dump a BMP image of current display into fname */
void HDumpGraf(char *fname)
{
BITMAPFILEHEADER FileHeader;
BITMAPINFOHEADER BitmapHeader;
BITMAPINFO *Info;
int ColorTableSize;
int ImageSize;
FILE *fp;
char *img;
HDC dc = GetDC(theWindow);
HBITMAP temp = CreateCompatibleBitmap(memDC,1,1);
SelectObject(memDC,temp);
/* retrieve information about the bitmap */
BitmapHeader.biSize = sizeof(BITMAPINFOHEADER);
BitmapHeader.biBitCount = 0;
GetDIBits(memDC,theBitmap,0,0,NULL,&BitmapHeader,BI_RGB);
switch (BitmapHeader.biCompression) {
case BI_RGB:
if (BitmapHeader.biBitCount > 8) {
ColorTableSize = 0;
}
else {
ColorTableSize = BitmapHeader.biClrUsed*sizeof(RGBQUAD);
}
break;
case BI_RLE8:
case BI_RLE4:
ColorTableSize = BitmapHeader.biClrUsed*sizeof(RGBQUAD);
break;
case BI_BITFIELDS:
ColorTableSize = 3*sizeof(DWORD);
}
Info = (BITMAPINFO *) New(&gcheap,sizeof(BITMAPINFOHEADER) + ColorTableSize);
memcpy(Info,&BitmapHeader,sizeof(BITMAPINFOHEADER));
ImageSize = BitmapHeader.biSizeImage;
img = New(&gcheap,ImageSize);
GetDIBits(memDC,theBitmap,0,ClientRect.bottom,img,Info,BI_RGB);
FileHeader.bfType = 0x4d42; /* 'BM' */
FileHeader.bfSize = sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER) +
ImageSize + ColorTableSize;
FileHeader.bfReserved1 = FileHeader.bfReserved2 = 0;
FileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + ColorTableSize;
fp = fopen(fname,"wb");
fwrite(&FileHeader,1,sizeof(BITMAPFILEHEADER),fp);
fwrite(Info,1,sizeof(BITMAPINFOHEADER) + ColorTableSize,fp);
fwrite(img,1,ImageSize,fp);
fclose(fp);
SelectObject(memDC,theBitmap);
DeleteObject(temp);
Dispose(&gcheap,Info);
Dispose(&gcheap,img);
}
示例10: HDrawImage
/* EXPORT->HDrawImage: draw grey scale image stored in p */
void HDrawImage(unsigned char *p, int x, int y, int width, int height)
{
HDC tdc = GetDC(theWindow);
HDC dc = CreateCompatibleDC(memDC);
HBITMAP bm = CreateCompatibleBitmap(tdc,width,height);
HGDIOBJ OldObject;
char *data = New(&gcheap,sizeof(BITMAPINFOHEADER) +
sizeof(RGBQUAD)*MAX_GREYS);
BITMAPINFOHEADER *BitmapHeader = (BITMAPINFOHEADER *) data;
RGBQUAD *ColorTable = (RGBQUAD *) (data + sizeof(BITMAPINFOHEADER));
BITMAPINFO *Info = (BITMAPINFO *) data;
int i,j;
/* if the length of the scan line is not a */
/* multiple of four, the bitmap must be reshaped. */
/* SetDIBits() expects scan lines to start on word boundaries. */
int ScanLineLen = 4*(1+(width-1)/4);
unsigned char *reshaped = NULL;
BitmapHeader->biSize = sizeof(BITMAPINFOHEADER);
BitmapHeader->biWidth = width;
BitmapHeader->biHeight = -height;
BitmapHeader->biPlanes = 1;
BitmapHeader->biBitCount = 8;
BitmapHeader->biCompression = 0;
BitmapHeader->biSizeImage = 0;
BitmapHeader->biXPelsPerMeter = 0;
BitmapHeader->biYPelsPerMeter = 0;
BitmapHeader->biClrUsed = MAX_GREYS;
BitmapHeader->biClrImportant = MAX_GREYS;
for (i=0;i<MAX_GREYS;i++) {
ColorTable[i].rgbRed =
ColorTable[i].rgbBlue =
ColorTable[i].rgbGreen = greys[i];
ColorTable[i].rgbReserved = 0;
}
if (ScanLineLen != width) {
reshaped = (unsigned char *) New(&gcheap,height*ScanLineLen);
for (i=0;i<height;i++) {
for (j=0;j<width;j++) {
reshaped[i*ScanLineLen+j] = p[i*width+j];
}
}
SetDIBits(memDC,bm,0,height,reshaped,Info,DIB_RGB_COLORS);
Dispose(&gcheap,reshaped);
}
else {
SetDIBits(memDC,bm,0,height,p,Info,DIB_RGB_COLORS);
}
OldObject = SelectObject(dc,bm);
BitBlt(memDC,x,y,width,height,dc,0,0,SRCCOPY);
if (WritingToMeta) { /* bitmap source location differs */
BitBlt(tdc,x,y,width,height,dc,x,y,SRCCOPY);
}
else {
BitBlt(tdc,x,y,width,height,dc,0,0,SRCCOPY);
}
DeleteDC(dc);
DeleteObject(bm);
ReleaseDC(theWindow,tdc);
Dispose(&gcheap,data);
}
示例11: Dispose
CDVDVideoCodecMFC::~CDVDVideoCodecMFC() {
Dispose();
}
示例12: Dispose
void CDVDDemuxShoutcast::Reset()
{
CDVDInputStream* pInputStream = m_pInput;
Dispose();
Open(pInputStream);
}
示例13: Dispose
CDVDDemuxFFmpeg::~CDVDDemuxFFmpeg()
{
Dispose();
DeleteCriticalSection(&m_critSection);
}
示例14: if
bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput)
{
AVInputFormat* iformat = NULL;
std::string strFile;
m_iCurrentPts = DVD_NOPTS_VALUE;
m_speed = DVD_PLAYSPEED_NORMAL;
if (!pInput) return false;
if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllAvFormat.Load()) {
CLog::Log(LOGERROR,"CDVDDemuxFFmpeg::Open - failed to load ffmpeg libraries");
return false;
}
// register codecs
m_dllAvFormat.av_register_all();
m_dllAvFormat.url_set_interrupt_cb(interrupt_cb);
// could be used for interupting ffmpeg while opening a file (eg internet streams)
// url_set_interrupt_cb(NULL);
m_pInput = pInput;
strFile = m_pInput->GetFileName();
bool streaminfo = true; /* set to true if we want to look for streams before playback*/
if( m_pInput->GetContent().length() > 0 )
{
std::string content = m_pInput->GetContent();
/* check if we can get a hint from content */
if( content.compare("audio/aacp") == 0 )
iformat = m_dllAvFormat.av_find_input_format("aac");
else if( content.compare("audio/aac") == 0 )
iformat = m_dllAvFormat.av_find_input_format("aac");
else if( content.compare("audio/mpeg") == 0 )
iformat = m_dllAvFormat.av_find_input_format("mp3");
else if( content.compare("video/mpeg") == 0 )
iformat = m_dllAvFormat.av_find_input_format("mpeg");
else if( content.compare("video/flv") == 0 )
iformat = m_dllAvFormat.av_find_input_format("flv");
else if( content.compare("video/x-flv") == 0 )
iformat = m_dllAvFormat.av_find_input_format("flv");
/* these are likely pure streams, and as such we don't */
/* want to try to look for streaminfo before playback */
if( iformat )
streaminfo = false;
}
if( m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG) )
{
g_urltimeout = GetTickCount() + 10000;
// special stream type that makes avformat handle file opening
// allows internal ffmpeg protocols to be used
if( m_dllAvFormat.av_open_input_file(&m_pFormatContext, strFile.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL) < 0 )
{
CLog::Log(LOGDEBUG, "Error, could not open file %s", strFile.c_str());
Dispose();
return false;
}
}
else
{
g_urltimeout = 0;
// initialize url context to be used as filedevice
URLContext* context = (URLContext*)m_dllAvUtil.av_mallocz(sizeof(struct URLContext) + strFile.length() + 1);
context->prot = &dvd_file_protocol;
context->priv_data = (void*)m_pInput;
context->max_packet_size = FFMPEG_FILE_BUFFER_SIZE;
if (m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD))
{
context->max_packet_size = FFMPEG_DVDNAV_BUFFER_SIZE;
context->is_streamed = 1;
}
if (m_pInput->IsStreamType(DVDSTREAM_TYPE_TV))
{
if(m_pInput->Seek(0, SEEK_POSSIBLE) == 0)
context->is_streamed = 1;
// this actually speeds up channel changes by almost a second
// however, it alsa makes player not buffer anything, this
// leads to buffer underruns in audio renderer
//if(context->is_streamed)
// streaminfo = false;
}
else
{
if(m_pInput->Seek(0, SEEK_POSSIBLE) == 0)
context->is_streamed = 1;
}
#if LIBAVFORMAT_VERSION_INT >= (52<<16)
context->filename = (char *) &context[1];
#endif
strcpy(context->filename, strFile.c_str());
//.........这里部分代码省略.........
示例15: Dispose
CanvasGDIP::~CanvasGDIP()
{
Dispose();
}