⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glut

📁 浙江大学 RoboCup3D 2006 源代码
💻
📖 第 1 页 / 共 4 页
字号:
static  BitmapCharRec ch23 = {9,9,0,-3,9,ch23data};

/* char: 0x16 */

static  GLubyte ch22data[] = {
0x8,0x8,0x8,0x8,0x8,0x8,0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
};

static  BitmapCharRec ch22 = {5,15,0,3,9,ch22data};

/* char: 0x15 */

static  GLubyte ch21data[] = {
0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
};

static  BitmapCharRec ch21 = {5,15,-4,3,9,ch21data};

/* char: 0x14 */

static  GLubyte ch20data[] = {
0xff,0x80,
};

static  BitmapCharRec ch20 = {9,1,0,1,9,ch20data};

/* char: 0x13 */

static  GLubyte ch19data[] = {
0xff,0x80,
};

static  BitmapCharRec ch19 = {9,1,0,-1,9,ch19data};

/* char: 0x12 */

static  GLubyte ch18data[] = {
0xff,0x80,
};

static  BitmapCharRec ch18 = {9,1,0,-3,9,ch18data};

/* char: 0x11 */

static  GLubyte ch17data[] = {
0xff,0x80,
};

static  BitmapCharRec ch17 = {9,1,0,-5,9,ch17data};

/* char: 0x10 */

static  GLubyte ch16data[] = {
0xff,0x80,
};

static  BitmapCharRec ch16 = {9,1,0,-7,9,ch16data};

/* char: 0xf */

static  GLubyte ch15data[] = {
0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0,
0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,
};

static  BitmapCharRec ch15 = {9,15,0,3,9,ch15data};

/* char: 0xe */

static  GLubyte ch14data[] = {
0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
};

static  BitmapCharRec ch14 = {5,9,-4,-3,9,ch14data};

/* char: 0xd */

static  GLubyte ch13data[] = {
0x80,0x80,0x80,0x80,0x80,0x80,0xf8,
};

static  BitmapCharRec ch13 = {5,7,-4,3,9,ch13data};

/* char: 0xc */

static  GLubyte ch12data[] = {
0x8,0x8,0x8,0x8,0x8,0x8,0xf8,
};

static  BitmapCharRec ch12 = {5,7,0,3,9,ch12data};

/* char: 0xb */

static  GLubyte ch11data[] = {
0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
};

static  BitmapCharRec ch11 = {5,9,0,-3,9,ch11data};

/* char: 0xa */

static  GLubyte ch10data[] = {
0x8,0x8,0x8,0x8,0x3e,0x0,0x20,0x50,0x88,0x88,
};

static  BitmapCharRec ch10 = {7,10,-1,2,9,ch10data};

/* char: 0x9 */

static  GLubyte ch9data[] = {
0x3e,0x20,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88,
};

static  BitmapCharRec ch9 = {7,10,-1,2,9,ch9data};

/* char: 0x8 */

static  GLubyte ch8data[] = {
0xfe,0x10,0x10,0xfe,0x10,0x10,
};

static  BitmapCharRec ch8 = {7,6,-1,0,9,ch8data};

/* char: 0x7 */

static  GLubyte ch7data[] = {
0x70,0x88,0x88,0x70,
};

static  BitmapCharRec ch7 = {5,4,-2,-6,9,ch7data};

/* char: 0x6 */

static  GLubyte ch6data[] = {
0x20,0x20,0x3c,0x20,0x3e,0x0,0xf8,0x80,0x80,0x80,
};

static  BitmapCharRec ch6 = {7,10,-1,2,9,ch6data};

/* char: 0x5 */

static  GLubyte ch5data[] = {
0x22,0x22,0x3c,0x22,0x3c,0x0,0x78,0x80,0x80,0x78,
};

static  BitmapCharRec ch5 = {7,10,-1,2,9,ch5data};

/* char: 0x4 */

static  GLubyte ch4data[] = {
0x10,0x10,0x1c,0x10,0x1e,0x80,0x80,0xe0,0x80,0xf0,
};

static  BitmapCharRec ch4 = {7,10,-1,2,9,ch4data};

/* char: 0x3 */

static  GLubyte ch3data[] = {
0x8,0x8,0x8,0x3e,0x0,0x88,0x88,0xf8,0x88,0x88,
};

static  BitmapCharRec ch3 = {7,10,-1,2,9,ch3data};

/* char: 0x2 */

static  GLubyte ch2data[] = {
0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
};

static  BitmapCharRec ch2 = {8,14,0,3,9,ch2data};

/* char: 0x1 */

static  GLubyte ch1data[] = {
0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,
};

static  BitmapCharRec ch1 = {7,7,-1,0,9,ch1data};

static  BitmapCharRec *  chars[] = {
&ch0,
&ch1,
&ch2,
&ch3,
&ch4,
&ch5,
&ch6,
&ch7,
&ch8,
&ch9,
&ch10,
&ch11,
&ch12,
&ch13,
&ch14,
&ch15,
&ch16,
&ch17,
&ch18,
&ch19,
&ch20,
&ch21,
&ch22,
&ch23,
&ch24,
&ch25,
&ch26,
&ch27,
&ch28,
&ch29,
&ch30,
&ch31,
&ch32,
&ch33,
&ch34,
&ch35,
&ch36,
&ch37,
&ch38,
&ch39,
&ch40,
&ch41,
&ch42,
&ch43,
&ch44,
&ch45,
&ch46,
&ch47,
&ch48,
&ch49,
&ch50,
&ch51,
&ch52,
&ch53,
&ch54,
&ch55,
&ch56,
&ch57,
&ch58,
&ch59,
&ch60,
&ch61,
&ch62,
&ch63,
&ch64,
&ch65,
&ch66,
&ch67,
&ch68,
&ch69,
&ch70,
&ch71,
&ch72,
&ch73,
&ch74,
&ch75,
&ch76,
&ch77,
&ch78,
&ch79,
&ch80,
&ch81,
&ch82,
&ch83,
&ch84,
&ch85,
&ch86,
&ch87,
&ch88,
&ch89,
&ch90,
&ch91,
&ch92,
&ch93,
&ch94,
&ch95,
&ch96,
&ch97,
&ch98,
&ch99,
&ch100,
&ch101,
&ch102,
&ch103,
&ch104,
&ch105,
&ch106,
&ch107,
&ch108,
&ch109,
&ch110,
&ch111,
&ch112,
&ch113,
&ch114,
&ch115,
&ch116,
&ch117,
&ch118,
&ch119,
&ch120,
&ch121,
&ch122,
&ch123,
&ch124,
&ch125,
&ch126,
&ch127,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
&ch160,
&ch161,
&ch162,
&ch163,
&ch164,
&ch165,
&ch166,
&ch167,
&ch168,
&ch169,
&ch170,
&ch171,
&ch172,
&ch173,
&ch174,
&ch175,
&ch176,
&ch177,
&ch178,
&ch179,
&ch180,
&ch181,
&ch182,
&ch183,
&ch184,
&ch185,
&ch186,
&ch187,
&ch188,
&ch189,
&ch190,
&ch191,
&ch192,
&ch193,
&ch194,
&ch195,
&ch196,
&ch197,
&ch198,
&ch199,
&ch200,
&ch201,
&ch202,
&ch203,
&ch204,
&ch205,
&ch206,
&ch207,
&ch208,
&ch209,
&ch210,
&ch211,
&ch212,
&ch213,
&ch214,
&ch215,
&ch216,
&ch217,
&ch218,
&ch219,
&ch220,
&ch221,
&ch222,
&ch223,
&ch224,
&ch225,
&ch226,
&ch227,
&ch228,
&ch229,
&ch230,
&ch231,
&ch232,
&ch233,
&ch234,
&ch235,
&ch236,
&ch237,
&ch238,
&ch239,
&ch240,
&ch241,
&ch242,
&ch243,
&ch244,
&ch245,
&ch246,
&ch247,
&ch248,
&ch249,
&ch250,
&ch251,
&ch252,
&ch253,
&ch254,
&ch255,
};

 BitmapFontRec glutBitmap9By15 = {
"-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1",
256,
0,
chars
};

void*
__glutFont(void *font)
{
  switch((int)font) {
//  case (int)GLUT_STROKE_ROMAN:
//    return &glutStrokeRoman;
//  case (int)GLUT_STROKE_MONO_ROMAN:
//    return &glutStrokeMonoRoman;
  case (int)GLUT_BITMAP_9_BY_15:
    return &glutBitmap9By15;
//  case (int)GLUT_BITMAP_8_BY_13:
//    return &glutBitmap8By13;
//  case (int)GLUT_BITMAP_TIMES_ROMAN_10:
//    return &glutBitmapTimesRoman10;
//  case (int)GLUT_BITMAP_TIMES_ROMAN_24:
//    return &glutBitmapTimesRoman24;
//  case (int)GLUT_BITMAP_HELVETICA_10:
//    return &glutBitmapHelvetica10;
//  case (int)GLUT_BITMAP_HELVETICA_12:
//    return &glutBitmapHelvetica12;
//  case (int)GLUT_BITMAP_HELVETICA_18:
//    return &glutBitmapHelvetica18;
  }
  __glutFatalError("out of memory.");
  /* NOTREACHED */

  return NULL;	/* keep MSVC compiler happy */
}

static void
initQuadObj(void)
{
  quadObj = gluNewQuadric();
  if (!quadObj) {
    __glutFatalError("out of memory.");
  }
}

void APIENTRY
glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
{
  QUAD_OBJ_INIT();
  gluQuadricDrawStyle(quadObj, GLU_FILL);
  gluQuadricNormals(quadObj, GLU_SMOOTH);
  /* If we ever changed/used the texture or orientation state
     of quadObj, we'd need to change it to the defaults here
     with gluQuadricTexture and/or gluQuadricOrientation. */
  gluSphere(quadObj, radius, slices, stacks);
}

void APIENTRY
glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
{
  QUAD_OBJ_INIT();
  gluQuadricDrawStyle(quadObj, GLU_LINE);
  gluQuadricNormals(quadObj, GLU_SMOOTH);
  /* If we ever changed/used the texture or orientation state
     of quadObj, we'd need to change it to the defaults here
     with gluQuadricTexture and/or gluQuadricOrientation. */
  gluSphere(quadObj, radius, slices, stacks);
}
void APIENTRY 
glutBitmapCharacter(GLUTbitmapFont font, int c)
{
   BitmapCharRec *ch;
  BitmapFontPtr fontinfo;
  GLint swapbytes, lsbfirst, rowlength;
  GLint skiprows, skippixels, alignment;

#if defined(_WIN32)
  fontinfo = (BitmapFontPtr) __glutFont(font);
#else
  fontinfo = (BitmapFontPtr) font;
#endif

  if (c < fontinfo->first ||
    c >= fontinfo->first + fontinfo->num_chars)
    return;
  ch = fontinfo->ch[c - fontinfo->first];
  if (ch) {
    /* Save current modes. */
    glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
    glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
    glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
    glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
    glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
    glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
    /* Little endian machines (DEC Alpha for example) could
       benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
       instead of GL_FALSE, but this would require changing the
       generated bitmaps too. */
    glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
    glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
    glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
    glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    glBitmap(ch->width, ch->height, ch->xorig, ch->yorig,
      ch->advance, 0, ch->bitmap);
    /* Restore saved modes. */
    glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
    glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
    glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
    glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
    glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
  }
}

int APIENTRY
glutBitmapWidth(GLUTbitmapFont font, int c)
{
  BitmapFontPtr fontinfo;
  BitmapCharRec *ch;

#ifdef _WIN32
  fontinfo = (BitmapFontPtr) __glutFont(font);
#else
  fontinfo = (BitmapFontPtr) font;
#endif

  if (c < fontinfo->first || c >= fontinfo->first + fontinfo->num_chars)
    return 0;
  ch = fontinfo->ch[c - fontinfo->first];
  if (ch)
    return ch->advance;
  else
    return 0;
}

#endif
/////////////// GLUT Header End ///////////////////////
///////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -