Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Source/SR_ConfigData.c
/****************************************************************************** |
** ** |
** Module: SR_ConfigData.c ** |
** ** |
** ** |
** Purpose: Generic sample renderer routines ** |
** ** |
** ** |
** ** |
** Copyright (C) 1996-1997 Apple Computer, Inc. All rights reserved. ** |
** ** |
** ** |
*****************************************************************************/ |
#include <assert.h> |
#include <string.h> |
#include "QD3D.h" |
#include "SR.h" |
#include "SR_ConfigData.h" |
#define LOCAL_BUFFER_SIZE sizeof(short) |
/*===========================================================================*\ |
* |
* Routine: SR_GetConfigurationData() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3Status SR_GetConfigurationData( |
TQ3RendererObject renderer, |
unsigned char *dataBuffer, |
unsigned long bufferSize, |
unsigned long *actualDataSize, |
void *rendererPrivate) |
{ |
UNUSED(renderer); |
*actualDataSize = LOCAL_BUFFER_SIZE; |
if (dataBuffer != NULL) { |
if (bufferSize >= LOCAL_BUFFER_SIZE) { |
memcpy( |
(char *) dataBuffer, |
(char *) &(((TSRPrivate *) rendererPrivate)->dummyConfigData), |
LOCAL_BUFFER_SIZE); |
} else { |
memcpy( |
(char *) dataBuffer, |
(char *) &(((TSRPrivate *) rendererPrivate)->dummyConfigData), |
bufferSize); |
*actualDataSize = bufferSize; |
} |
} |
return (kQ3Success); |
} |
/*===========================================================================*\ |
* |
* Routine: SR_GetConfigurationData() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3Status SR_SetConfigurationData( |
TQ3RendererObject renderer, |
unsigned char *dataBuffer, |
unsigned long bufferSize, |
void *rendererPrivate) |
{ |
UNUSED(renderer); |
if (dataBuffer != NULL && bufferSize == LOCAL_BUFFER_SIZE) { |
memcpy( |
(char *) &(((TSRPrivate *) rendererPrivate)->dummyConfigData), |
(char *) dataBuffer, |
bufferSize); |
return (kQ3Success); |
} |
return (kQ3Failure); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14