VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_error.c@ 18171

最後變更 在這個檔案從18171是 15532,由 vboxsync 提交於 16 年 前

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.4 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7
8#include "cr_error.h"
9#include "cr_environment.h"
10#include "cr_pack.h"
11#include "packer.h"
12
13
14/*
15 * Set the error handler callback
16 */
17void crPackErrorFunction( CRPackContext *pc, CRPackErrorHandlerFunc function )
18{
19 pc->Error = function;
20}
21
22
23/*
24 * This function is called by the packer functions when it detects and
25 * OpenGL error.
26 */
27void __PackError( int line, const char *file, GLenum error, const char *info)
28{
29 GET_PACKER_CONTEXT(pc);
30
31 if (pc->Error)
32 pc->Error( line, file, error, info );
33
34 if (crGetenv("CR_DEBUG"))
35 {
36 char *glerr;
37
38 switch (error) {
39 case GL_NO_ERROR:
40 glerr = "GL_NO_ERROR";
41 break;
42 case GL_INVALID_VALUE:
43 glerr = "GL_INVALID_VALUE";
44 break;
45 case GL_INVALID_ENUM:
46 glerr = "GL_INVALID_ENUM";
47 break;
48 case GL_INVALID_OPERATION:
49 glerr = "GL_INVALID_OPERATION";
50 break;
51 case GL_STACK_OVERFLOW:
52 glerr = "GL_STACK_OVERFLOW";
53 break;
54 case GL_STACK_UNDERFLOW:
55 glerr = "GL_STACK_UNDERFLOW";
56 break;
57 case GL_OUT_OF_MEMORY:
58 glerr = "GL_OUT_OF_MEMORY";
59 break;
60 case GL_TABLE_TOO_LARGE:
61 glerr = "GL_TABLE_TOO_LARGE";
62 break;
63 default:
64 glerr = "unknown";
65 break;
66 }
67
68 crWarning( "GL error in packer: %s, line %d: %s: %s",
69 file, line, glerr, info );
70 }
71}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette