本文整理汇总了C++中RGB15函数的典型用法代码示例。如果您正苦于以下问题:C++ RGB15函数的具体用法?C++ RGB15怎么用?C++ RGB15使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RGB15函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loseRender
void loseRender(Board *b, int step){
glResetMatrixStack();
if ( step > 1000 )
return;
glMatrixMode(GL_PROJECTION);
gluPerspective(20, 256.0 / 192.0, 0.1, 40);
float d = (float)step / 6.0;
gluLookAt( 5.0 + d, 5.0 + d, 7.0 + d, //camera possition
1.0, 0.0, 1.5, //look at
0.0, 1.0, 0.0); //up
glRotateY(step*3);
glLight(0, RGB15(31,31,31), 0, floattov10(1.0)-1, 0);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glMaterialf(GL_AMBIENT, RGB15(8,8,8));
glMaterialf(GL_DIFFUSE, RGB15(31,31,31));
glMaterialf(GL_SPECULAR, RGB15(31,31,31));
glMaterialf(GL_EMISSION, RGB15(8,8,8));
glMaterialShinyness();
glPolyFmt( POLY_ALPHA(31) | POLY_CULL_BACK | POLY_FORMAT_LIGHT0 );
glBindTexture(0, textureID);
b->draw();
glFlush(0);
swiWaitForVBlank();
}
示例2: nds_init_nhwindows
/*
* Initialize our window port. Of course, there are no arguments but we
* also initialize the graphics subsystem, here, so we'll be prepared for
* later.
*/
void nds_init_nhwindows(int *argc, char **argv)
{
int i;
system_font = read_bdf("font.bdf");
if (system_font == NULL) {
iprintf("Error loading font!\n");
return;
}
if (nds_init_map()) {
iprintf("Error loading tiles!\n");
return;
}
keysSetRepeat(30, 2);
for (i = 0; i < MAX_WINDOWS; i++) {
windows[i] = NULL;
}
/* Set up our palettes. */
BG_PALETTE_SUB[255] = RGB15(31,31,31);
nds_load_palette("minimap.pal", BG_PALETTE_SUB + 16);
BG_PALETTE_SUB[C_CURSOR] = RGB15(31,0, 0);
iflags.window_inited = true;
/* Get these set up for our windowing routines */
up_arrow = alloc_ppm(16, 16);
down_arrow = alloc_ppm(16, 16);
okay_button = alloc_ppm(16, 16);
cancel_button = alloc_ppm(16, 16);
_nds_copy_header_pixels(up_arrow_data, (unsigned char *)up_arrow->bitmap,
MAP_COLOUR(CLR_BLACK), MAP_COLOUR(CLR_WHITE));
_nds_copy_header_pixels(down_arrow_data, (unsigned char *)down_arrow->bitmap,
MAP_COLOUR(CLR_BLACK), MAP_COLOUR(CLR_WHITE));
_nds_copy_header_pixels(okay_data, (unsigned char *)okay_button->bitmap,
MAP_COLOUR(CLR_BLACK), MAP_COLOUR(CLR_WHITE));
_nds_copy_header_pixels(cancel_data, (unsigned char *)cancel_button->bitmap,
MAP_COLOUR(CLR_BLACK), MAP_COLOUR(CLR_WHITE));
if (nds_init_cmd() < 0) {
nds_error();
}
nds_init_msg();
font_bdf_init();
text_dims(system_font, "*", &tag_width, NULL);
tag_width *= 4;
}
示例3: ds2_main
void ds2_main(void)
{
int err;
ds2_setCPUclocklevel(11);
//Initial video and audio and other input and output
err = ds2io_init(1024);
if(err) goto _failure;
ConsoleInit(RGB15(31, 31, 31), RGB15(0, 0, 0), DOWN_SCREEN, 2);
unsigned int Time = getSysTime();
//go to user main funtion
main (0, 0);
Time = getSysTime() - Time;
printf("%u units\n\nof 42.667 us", Time);
ds2_setCPUclocklevel(0);
struct key_buf inputdata;
do
ds2_getrawInput(&inputdata);
while (inputdata.key == 0);
ds2_setBacklight(3);
ds2_plug_exit();
while (1);
_failure:
ds2_plug_exit();
}
示例4: glEnable
void App_Test::display_Model()
{
// gluLookAtf32( this->camera.getPosition()->get_vec_ox(),this->camera.getPosition()->get_vec_oy(),this->camera.getPosition()->get_vec_oz(),
// this->camera.getLookAt()->get_vec_ox(),this->camera.getLookAt()->get_vec_oy(),this->camera.getLookAt()->get_vec_oz(),
// 0,4096,0
// );
// glLoadIdentity();
glEnable(GL_TEXTURE_2D);
glEnable(GL_ANTIALIAS);
glEnable(GL_OUTLINE);
glLight(0, RGB15(31,31,31) , 0, floattov10(-6.0), floattov10(-1.0));
glSetOutlineColor(0,RGB15(0,0,0));
glPolyFmt(POLY_ID(0) | POLY_ALPHA(31)|POLY_CULL_NONE | POLY_FORMAT_LIGHT0 | POLY_TOON_HIGHLIGHT);
// glPolyFmt(POLY_ALPHA(31)|POLY_CULL_NONE | POLY_FORMAT_LIGHT0);
glColor3b(31,31,31);
glBindTexture(GL_TEXTURE_2D, this->textureID[0]);
glTranslatef(0,-6,0);
glRotatef(90,-1,0,0);
glRotatef(-90,0,0,1);
glCallList( (u32 *) this->model_selected);
glEnd();
}
示例5: updateCenter
void updateCenter(AppState & state) {
Point bottomLeft = state.convertBufferToScreen(Point(0,0));
Point topRight = state.convertBufferToScreen(Point(MY_BG_W,MY_BG_H));
Point newCenter = state.convertScreenToImage(Point(SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
// printf("--------------\n");
// printf("%d %d\n", bottomLeft.x, bottomLeft.y);
// printf("%d %d\n", topRight.x, topRight.y);
// printf("%d %d\n", newCenter.x, newCenter.y);
if (bottomLeft.x > 0 || bottomLeft.y > 0 || topRight.x < SCREEN_WIDTH || topRight.y < SCREEN_HEIGHT) {
//Point newCenter = state.convertScreenToImage(Point(SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
state.scroll_x = MY_BG_W/2-SCREEN_WIDTH/2;
state.scroll_y = MY_BG_H/2-SCREEN_HEIGHT/2;
state.center_x = newCenter.x;
state.center_y = newCenter.y;
// printf("%d %d\n", state.center_x, state.center_y);
bgHide(3);
fillDisplay(RGB15(0,0,0) | BIT(15), state.lastPage, state);
drawPage(state.currentPage, RGB15(31,0,0) | BIT(15), state);
}
bgSetScroll(3, state.scroll_x, state.scroll_y);
bgUpdate();
bgShow(3);
}
示例6: __attribute__
void __attribute__((noreturn)) __sassert(const char* file, int line, const char* cond, const char* msg)
{
if (isUserMode()) FeOS_swi_assertfail(file, line, cond, msg);
videoReset();
videoSetMode(MODE_0_2D);
videoSetModeSub(MODE_0_2D);
PrintConsole* conmain = consoleInit(NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 0, 1, true, true);
memcpy(&oConSub, consoleGetDefault(), sizeof(PrintConsole));
PrintConsole* consub = consoleInit(&oConSub, 0, BgType_Text4bpp, BgSize_T_256x256, 0, 1, false, true);
InstallConThunks();
consoleSelect(conmain);
BG_PALETTE[0] = RGB15(31,0,31);
BG_PALETTE[255] = RGB15(31,31,31);
BG_PALETTE_SUB[0] = RGB15(31,0,31);
BG_PALETTE_SUB[255] = RGB15(31,31,31);
iprintf("\x1b[5CKernel assertion failure!\n\nCondition: %s\n\n%s:%d\n\nMessage: %s\n", cond, file, line, msg);
consoleSelect(consub);
iprintf("\x1b[5CStacktrace coming soon\n\nInstead, here's a kitten:\n\n");
const char** i;
for (i = meow; *i; i ++)
iprintf("%s\n", *i);
for (;;)
swiWaitForVBlank();
}
示例7: robot_clone_wars
void robot_clone_wars(int t)
{
#define SPACE_FLOOR 1
#define FINAL_WALK_ON 1
#define LINES 6
#define SPACING 16384
int i, j;
//rotateX(2560);
if ( (t & 1) == 0 ) { // different camera for different screens
translate(5120, 44032, 20480);
rotateZ(1792);
} else {
rotateX(2560);
}
#if SPACE_FLOOR
push();
translate(0, -6144, -4096*4);
rotateX(-12867/2);
scale(4096*16, 4096*10, 4096*10);
spot(RGB15(0, 7, 3), RGB15(0, 2, 1), 0, -64);
pop();
#endif
#if SPACE_FLOOR
int z = t*256-16384;
#else
int z = t*256*8-16384*8;
#endif
if ( z > 0 )
z = 0;
int lines = (t-192+8)/8;
if ( lines < 2 )
lines = 2;
else if ( lines > LINES )
lines = LINES;
for ( i = 1 ; i < lines ; i++ ) {
translate(0, 0, -8192);
for ( j = 0 ; j < i ; j++ ) {
if ( j == 2 && i == 5 )
continue;
push();
translate(j * SPACING - ((i-1)*SPACING)/2, jump(t-i*4)+z, 0);
#if FINAL_WALK_ON
if ( t < 512 )
robot(8, 256);
else
robot(8+t-512, 256);
#else
robot(8);
#endif
pop();
}
}
}
示例8: CglCanvas
CglScreenMainOverlay::CglScreenMainOverlay(void)
{
pCanvas=new CglCanvas(&VRAMBuf[16*256],ScreenWidth,ScreenHeight,pf15bit);
pCanvas->SetColor(RGB15(0,0,0));
glMemSet32CPU(RGB15(0,0,0),(u32*)pCanvas->GetScanLine(0),ScreenWidth*ScreenHeight*2);
SpriteInit(false,15);
}
示例9: fs_beam
void fs_beam(int t)
{
int h = 64+8+384-t*4;
if ( h < 0 )
h = 0;
GFX_POLY_FORMAT = LIGHT0|POLYFRONT|ALPHA(15);
spot(RGB15(0, 31, 4), RGB15(0, 31, 4), -32, h-384);
}
示例10: initMenu
void initMenu(void)
{
lcdMainOnTop();
videoSetMode(MODE_5_3D);
videoSetModeSub(MODE_5_2D);
vramSetPrimaryBanks(VRAM_A_TEXTURE,VRAM_B_TEXTURE,VRAM_C_SUB_BG,VRAM_D_TEXTURE);
initD3D();
glInit();
glEnable(GL_TEXTURE_2D);
glEnable(GL_ANTIALIAS);
glEnable(GL_BLEND);
glEnable(GL_OUTLINE);
glClearPolyID(63);
glClearDepth(0x7FFF);
glViewport(0,0,255,191);
initVramBanks(2);
initTextures();
initMenuScene();
initMenuButtons();
//TEMP
glLight(0, RGB15(31,31,31), cosLerp(4096), 0, sinLerp(4096));
glMaterialf(GL_AMBIENT, RGB15(8,8,8));
glMaterialf(GL_DIFFUSE, RGB15(24,24,24));
glMaterialf(GL_SPECULAR, RGB15(0,0,0));
glMaterialf(GL_EMISSION, RGB15(0,0,0));
glSetToonTableRange(0, 15, RGB15(8,8,8)); //TEMP?
glSetToonTableRange(16, 31, RGB15(24,24,24)); //TEMP?
applyCameraState(&menuCamera,&cameraStates[4]);
tempState=cameraStates[4];
testTransition=startCameraTransition(&cameraStates[1],&cameraStates[4],64);
setupMenuPage(startMenuPage, startMenuPageLength);
logoMain=createTexture("logo.pcx", "menu");
logoRotate=createTexture("rotate_logo.pcx", "menu");
logoAlpha=31;
glSetOutlineColor(0,RGB15(0,0,0)); //TEMP?
glSetOutlineColor(1,RGB15(0,0,0)); //TEMP?
glSetOutlineColor(7,RGB15(0,0,0)); //TEMP?
NOGBA("END mem free : %dko (%do)",getMemFree()/1024,getMemFree());
fadeIn();
}
示例11: ClearScreen
void ClearScreen(void)
{
for(int i = 0; i < 256 * 192; i++)
{
VRAM_A[i] = RGB15(0,0,0);
}
draw::line(0,0,0,SCREEN_HEIGHT,RGB15(31,31,31));
draw::line(SCREEN_WIDTH,0,SCREEN_WIDTH,SCREEN_HEIGHT,RGB15(31,31,31));
draw::line(0,0,SCREEN_WIDTH,0,RGB15(31,31,31));
draw::line(0,SCREEN_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT,RGB15(31,31,31));
}
示例12: Screen_Init
/*
Screen_Init
Mode 5 gives us 2 text backgrounds 0-1 (tiled mode) and
2 extended rotation backgrounds 2-3. (linear fb)
Also we need to map 2 banks of vram so we have enough space for
our 512x512 surface.
*/
LOCALFUNC blnr Screen_Init(void)
{
videoSetMode(MODE_5_2D);
vramSetBankA(VRAM_A_MAIN_BG_0x06000000);
vramSetBankB(VRAM_B_MAIN_BG_0x06020000);
Display_bg2_Main = bgInit(2, BgType_Bmp8, BgSize_B8_512x512, 0, 0);
BG_PALETTE[0] = RGB15(31, 31, 31);
BG_PALETTE[1] = RGB15(0, 0, 0);
return trueblnr;
}
示例13: background
void background(int t)
{
#if FADES
if ( t == 1536 ) {
fade_current = 0;
fade_target = 16<<2;
}
#endif
if ( t < 1536 )
spot(RGB15(31, 31, 31), RGB15(12, 12, 31), 0, -64);
else
spot(RGB15(1, 5, 2), RGB15(0, 0, 0), 0, -64);
}
示例14: ResetColours
void BeatmapElements::ResetColours(bool fill)
{
mColours.clear();
mCurrentColour = 0;
if (fill)
{
mColours.push_back(RGB15(31,18,0));
mColours.push_back(RGB15(1,30,1));
mColours.push_back(RGB15(1,1,30));
mColours.push_back(RGB15(30,1,1));
}
}
示例15: glMaterialf
void MapDraw::material(int r, int g, int b)
{
// This seems to work alright.
//glMaterialf(GL_DIFFUSE, RGB15(r, g, b) | BIT(15)); /// Bit 15 enables the diffuse color to act like being set with glColor(), only with lighting support. When not using lighting, this is going to be the default color, just like being set with glColor().
glMaterialf(GL_DIFFUSE, RGB15(r, g, b));
glMaterialf(GL_AMBIENT, RGB15(r, g, b));
glMaterialf(GL_SPECULAR, RGB15(20, 20, 20)| BIT(15)); /// Bit 15 would have to be set here to enable a custom specularity table, instead of the default linear one.
glMaterialf(GL_EMISSION, RGB15(0, 0, 0));
//ds uses a table for shinyness..this generates a half-ass one
// NOTE: do not use this, at least not here, it slows shit down a lot.
// glMaterialShinyness();
}