本文整理汇总了C++中build_buffer函数的典型用法代码示例。如果您正苦于以下问题:C++ build_buffer函数的具体用法?C++ build_buffer怎么用?C++ build_buffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build_buffer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: aml_append
void aml_append(Aml *parent_ctx, Aml *child)
{
GArray *buf = build_alloc_array();
build_append_array(buf, child->buf);
switch (child->block_flags) {
case AML_OPCODE:
build_append_byte(parent_ctx->buf, child->op);
break;
case AML_EXT_PACKAGE:
build_extop_package(buf, child->op);
break;
case AML_PACKAGE:
build_package(buf, child->op);
break;
case AML_RES_TEMPLATE:
build_append_byte(buf, 0x79); /* EndTag */
/*
* checksum operations are treated as succeeded if checksum
* field is zero. [ACPI Spec 1.0b, 6.4.2.8 End Tag]
*/
build_append_byte(buf, 0);
/* fall through, to pack resources in buffer */
case AML_BUFFER:
build_buffer(buf, child->op);
break;
case AML_NO_OPCODE:
break;
default:
assert(0);
break;
}
build_append_array(parent_ctx->buf, buf);
build_free_array(buf);
}
开发者ID:J-Liu,项目名称:qemu,代码行数:35,代码来源:aml-build.c
示例2: reset
// ------------------------------------------------------------------- quit ---
void reset( void )
{
p_family = VERA;
p_size = 12.0;
p_invert = 0;
p_kerning = 1;
p_hinting = 1;
p_lcd_filtering = 1;
p_gamma = 1.0;
p_interval = 0.0;
p_weight = 0.33;
p_width = 1.0;
p_faux_weight = 0.0;
p_faux_italic = 0.0;
// FT_LCD_FILTER_LIGHT
p_primary = 1.0/3.0;
p_secondary = 1.0/3.0;
p_tertiary = 0.0/3.0;
// FT_LCD_FILTER_DEFAULT
// p_primary = 3.0/9.0;
// p_secondary = 2.0/9.0;
// p_tertiary = 1.0/9.0;
if( !p_lcd_filtering )
{
atlas = atlas_gray;
}
else
{
atlas = atlas_rgb;
}
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:36,代码来源:demo-atb-agg.c
示例3: set_lcd_filtering
// -------------------------------------------------- get/set lcd_filtering ---
void TW_CALL set_lcd_filtering( const void *value, void *data )
{
p_lcd_filtering = *(const int *) value;
if( p_lcd_filtering )
{
atlas = atlas_rgb;
}
else
{
atlas = atlas_gray;
}
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:14,代码来源:demo-atb-agg.c
示例4: set_lcd_filtering
// -------------------------------------------------- get/set lcd_filtering ---
void TW_CALL set_lcd_filtering( const void *value, void *data )
{
p_lcd_filtering = *(const int *) value;
if( p_lcd_filtering )
{
font_manager = font_manager_rgb;
}
else
{
font_manager = font_manager_a;
}
build_buffer();
}
开发者ID:JacobHensley,项目名称:GLEW-Graphics,代码行数:14,代码来源:atb-agg.c
示例5: sizeof
std::string IEServer::GetStatus() {
SYSTEM_INFO system_info;
::ZeroMemory(&system_info, sizeof(SYSTEM_INFO));
::GetNativeSystemInfo(&system_info);
OSVERSIONINFO os_version_info;
::ZeroMemory(&os_version_info, sizeof(OSVERSIONINFO));
os_version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
::GetVersionEx(&os_version_info);
// Allocate only 2 characters for the major and minor versions
// and 5 characters for the build number (+1 for null char)
vector<char> major_buffer(3);
_itoa_s(os_version_info.dwMajorVersion, &major_buffer[0], 3, 10);
vector<char> minor_buffer(3);
_itoa_s(os_version_info.dwMinorVersion, &minor_buffer[0], 3, 10);
vector<char> build_buffer(6);
_itoa_s(os_version_info.dwBuildNumber, &build_buffer[0], 6, 10);
std::string major_version(&major_buffer[0]);
std::string minor_version(&minor_buffer[0]);
std::string build_version(&build_buffer[0]);
std::string os_version = major_version + "." + minor_version + "." + build_version;
std::string arch = "x86";
if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
arch = "x64";
}
Json::Value build;
build["version"] = "2.21.0";
Json::Value os;
os["arch"] = arch;
os["name"] = "windows";
os["version"] = os_version;
Json::Value status;
status["build"] = build;
status["os"] = os;
Response response;
response.SetSuccessResponse(status);
return response.Serialize();
}
开发者ID:anahorny,项目名称:Selenium2,代码行数:44,代码来源:IEServer.cpp
示例6: main
int main(){
int n,i=0;
char *com;
scanf("%d",&n);
if(n==0)return 0;
build_buffer(n);
while(1){
com=(char*)malloc(sizeof(char)*10);
scanf("%[^\n]s",com);
command_exec(com);
}
return 0;
}
开发者ID:raunakkr,项目名称:DS_Algorithms,代码行数:19,代码来源:buffer.c
示例7: queryTag
int queryTag(int argc, char **argv) {
unsigned int tag;
unsigned int length = 4;
if(argc == 0) {
printf("%s: invalid arguments\r\n", argv[0]);
return -1;
} else {
tag = strtol(argv[1], 0, 16);
}
if(argc >= 2) length = strtol(argv[2], 0, 10);
volatile unsigned int *buffer = build_buffer(tag, length);
for(int i=0; i+3 <= argc; i++) {
buffer[i+5] = strtol(argv[i+3], 0, 16);
buffer[4] += 4;
}
sendTagBuffer(buffer);
if (buffer[1] == 0x80000000 && (buffer[4] & 0x7fffffff) == 4) {
printf("%08x\r\n", buffer[5]); // pretty printing for single int replies
} else {
dump((unsigned char *) buffer, buffer[0]);
}
return 0;
}
开发者ID:phire,项目名称:pimon,代码行数:24,代码来源:mailbox.c
示例8: set_family
// --------------------------------------------------------- get/set family ---
void TW_CALL set_family( const void *value, void *data )
{
p_family = *(const font_family_e *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:6,代码来源:demo-atb-agg.c
示例9: set_tertiary
// ----------------------------------------------------------- get/set tertiary ---
void TW_CALL set_tertiary( const void *value, void *data )
{
p_tertiary = *(const float *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:7,代码来源:demo-atb-agg.c
示例10: set_faux_italic
// ---------------------------------------------------- get/set faux_italic ---
void TW_CALL set_faux_italic( const void *value, void *data )
{
p_faux_italic = *(const float *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:6,代码来源:demo-atb-agg.c
示例11: set_size
// ----------------------------------------------------------- get/set size ---
void TW_CALL set_size( const void *value, void *data )
{
p_size = *(const float *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:7,代码来源:demo-atb-agg.c
示例12: set_width
// ---------------------------------------------------------- get/set width ---
void TW_CALL set_width( const void *value, void *data )
{
p_width = *(const float *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:6,代码来源:demo-atb-agg.c
示例13: set_interval
// ------------------------------------------------------- get/set interval ---
void TW_CALL set_interval( const void *value, void *data )
{
p_interval = *(const float *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:6,代码来源:demo-atb-agg.c
示例14: set_invert
// --------------------------------------------------------- get/set invert ---
void TW_CALL set_invert( const void *value, void *data )
{
p_invert = *(const int *) value;
build_buffer();
}
开发者ID:vbhartiya,项目名称:customgameengine,代码行数:6,代码来源:atb-agg.c
示例15: set_gamma
// ---------------------------------------------------------- get/set gamma ---
void TW_CALL set_gamma( const void *value, void *data )
{
p_gamma = *(const float *) value;
build_buffer();
}
开发者ID:vbhartiya,项目名称:customgameengine,代码行数:6,代码来源:atb-agg.c
示例16: set_int
// ------------------------------------------------------------ get/set int ---
void TW_CALL set_int( const void *value, void *data )
{
*(int *)data = *(const int *) value;
build_buffer();
}
开发者ID:JacobHensley,项目名称:GLEW-Graphics,代码行数:6,代码来源:atb-agg.c
示例17: build_buffer
// ----------------------------------------------------------- build_buffer ---
void
build_buffer( void )
{
vec2 pen;
texture_font_t *font;
vec4 black = {{0.0, 0.0, 0.0, 1.0}};
vec4 white = {{1.0, 1.0, 1.0, 1.0}};
vec4 none = {{1.0, 1.0, 1.0, 0.0}};
vec4 color = white;
if( p_invert )
{
color = black;
}
markup_t markup = {
.family = "Source Sans Pro",
.size = 10.0,
.bold = 0,
.italic = 0,
.spacing = p_interval,
.gamma = p_gamma,
.foreground_color = color,
.background_color = none,
.underline = 0,
.underline_color = color,
.overline = 0,
.overline_color = color,
.strikethrough = 0,
.strikethrough_color = color,
.font = 0,
};
text_buffer_clear( text_buffer );
texture_atlas_t * atlas = font_manager->atlas;
texture_atlas_clear( atlas );
if( p_family == VERA)
{
font = texture_font_new_from_file( atlas, p_size, "fonts/Vera.ttf" );
}
else if( p_family == VERA_MONO)
{
font = texture_font_new_from_file( atlas, p_size, "fonts/VeraMono.ttf" );
}
else if( p_family == LUCKIEST_GUY)
{
font = texture_font_new_from_file( atlas, p_size, "fonts/LuckiestGuy.ttf" );
}
else if( p_family == SOURCE_SANS )
{
font = texture_font_new_from_file( atlas, p_size, "fonts/SourceSansPro-Regular.ttf" );
}
else if( p_family == SOURCE_CODE )
{
font = texture_font_new_from_file( atlas, p_size, "fonts/SourceCodePro-Regular.ttf" );
}
else if( p_family == OLD_STANDARD )
{
font = texture_font_new_from_file( atlas, p_size, "fonts/OldStandard-Regular.ttf" );
}
else if( p_family == LOBSTER )
{
font = texture_font_new_from_file( atlas, p_size, "fonts/Lobster-Regular.ttf" );
}
else
{
fprintf( stderr, "Error : Unknown family type\n" );
return;
}
if (!font)
return;
markup.font = font;
font->hinting = p_hinting;
font->kerning = p_kerning;
font->filtering = 1;
float norm = 1.0/(p_primary + 2*p_secondary + 2*p_tertiary);
font->lcd_weights[0] = (unsigned char)(p_tertiary*norm*255);
font->lcd_weights[1] = (unsigned char)(p_secondary*norm*255);
font->lcd_weights[2] = (unsigned char)(p_primary*norm*255);
font->lcd_weights[3] = (unsigned char)(p_secondary*norm*255);
font->lcd_weights[4] = (unsigned char)(p_tertiary*norm*255);
pen.x = 10;
pen.y = 600 - font->height - 10;
text_buffer_printf( text_buffer, &pen, &markup, text, NULL );
// Post-processing for width and orientation
vertex_buffer_t * vbuffer = text_buffer->buffer;
size_t i;
for( i=0; i < vector_size( vbuffer->items ); ++i )
{
ivec4 *item = (ivec4 *) vector_get( vbuffer->items, i);
glyph_vertex_t * v0 = /* x0,y0 */
(glyph_vertex_t *) vector_get( vbuffer->vertices, item->vstart+0 );
//glyph_vertex_t * v1 = /* x0,y1 */
// (glyph_vertex_t *) vector_get( vbuffer->vertices, item->vstart+1 );
glyph_vertex_t * v2 = /* x1,y1 */
(glyph_vertex_t *) vector_get( vbuffer->vertices, item->vstart+2 );
//.........这里部分代码省略.........
开发者ID:JacobHensley,项目名称:GLEW-Graphics,代码行数:101,代码来源:atb-agg.c
示例18: set_float
// ---------------------------------------------------------- get/set float ---
void TW_CALL set_float( const void *value, void *data )
{
*(float *) data = *(const float *) value;
build_buffer();
}
开发者ID:JacobHensley,项目名称:GLEW-Graphics,代码行数:6,代码来源:atb-agg.c
示例19: set_hinting
// -------------------------------------------------------- get/set hinting ---
void TW_CALL set_hinting( const void *value, void *data )
{
p_hinting = *(const int *) value;
build_buffer();
}
开发者ID:DLthree,项目名称:Cocos-Freetype,代码行数:6,代码来源:demo-atb-agg.c
示例20: main
main()
{
double t,wps;
int str;
ui count,buflen;
int i,pcount=0;
char strbuf[10];
/* Open our log file */
for(i=1; i<32; ++i)
{
sprintf(strbuf,"cache.%d",i);
if (access(strbuf,0)) break;
}
record=fopen(strbuf,"w");
if (record==NULL) printf("Could not open record file %s. No record kept\n",strbuf);
else printf("\t\tA copy of this run will be kept in %s\n\n",strbuf);
printf("Memory tester v1.0\n");
printf("Author: [email protected], January 1996\n\n");
printf("On this machine, one word = %d bytes\n",sizeof(ui *));
printf("Reported access times are in nS per word.\n\n");
if (record!=NULL)
{
fprintf(record,"On this machine, one word = %d bytes\n",sizeof(ui *));
fprintf(record,"Reported access times are in nS per word.\n\n");
}
/* Start with a block of 256 words, each word is of type (ui *) */
build_buffer(256,1);
count=8;
do
{
count *= 2;
t = read_test(count);
}
while(t < 2);
fflush(stdout);
print_header();
count = (ui)((double)count * LOOPTIME / t);
for(buflen=256; buflen<=MAXBSIZE; buflen*=2)
{
if (buflen<256*1024) sprintf(strbuf,"%uk",buflen/256);
else sprintf(strbuf,"%uM",buflen/(256*1024));
printf("%-5.5s|",strbuf); fflush(stdout);
if (record!=NULL) fprintf(record,"%-5.5s|",strbuf);
for(str=1; str<buflen; str*=2)
{
build_buffer(buflen,str);
while(1)
{
t = read_test(count);
if (t<1.0) count*=3; else break;
}
wps = (double)(count) / t;
wps = 1.0e9 / wps;
if (wps>=1000)
{
printf("1k+ ");
if (record!=NULL) fprintf(record,"1k+ ");
}
else
{
printf("%-3d ", (int)wps);
if (record!=NULL) fprintf(record,"%-3d ", (int)wps);
}
fflush(stdout); if (record!=NULL) fflush(record);
count = (ui)((double)count * LOOPTIME / t);
}
putchar('\n');
if (record!=NULL) putc('\n',record);
}
if (record!=NULL) fclose(record);
}
开发者ID:tridge,项目名称:junkcode,代码行数:83,代码来源:cache.c
注:本文中的build_buffer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论