本文整理汇总了C++中WINDOW类的典型用法代码示例。如果您正苦于以下问题:C++ WINDOW类的具体用法?C++ WINDOW怎么用?C++ WINDOW使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WINDOW类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: c_move
void c_move( /*move pen */
void *win,
double x,
double y) {
WINDOW window = (WINDOW) win;
window->Move2d (x, y);
}
开发者ID:jan-ruzicka,项目名称:tesseract-ocr-sf,代码行数:8,代码来源:callcpp.cpp
示例2: c_draw
void c_draw( /*move pen */
void *win,
double x,
double y) {
WINDOW window = (WINDOW) win;
window->Draw2d (x, y);
}
开发者ID:jan-ruzicka,项目名称:tesseract-ocr-sf,代码行数:8,代码来源:callcpp.cpp
示例3: c_line_color_index
void c_line_color_index( /*set color */
void *win,
C_COL index) {
WINDOW window = (WINDOW) win;
// ASSERT_HOST(index>=0 && index<=48);
if (index < 0 || index > 48)
index = (C_COL) 1;
window->Line_color_index ((COLOUR) index);
}
开发者ID:jan-ruzicka,项目名称:tesseract-ocr-sf,代码行数:10,代码来源:callcpp.cpp
示例4: GUI_DCR
//*----------------------------------------------------------------------------
//* DCR function
//*----------------------------------------------------------------------------
void GUI_DCR(GUI_DRIVER_INFO* drv_info, unsigned int reason, HANDLE param)
{
GUI_DRIVER_DATA* drv_data;
WINDOW win = (WINDOW)param;
drv_data = drv_info->drv_data;
switch(reason)
{
case DCR_RESET:
display_init(drv_info);
break;
case DCR_OPEN:
if(win->mode.as_int)
{
// WINDOW objects
win->rect.x0 = 0;
win->rect.y0 = 0;
// win->rect.x1 = drv_info->lcd->size_x;
// win->rect.y1 = drv_info->lcd->size_y;
}
win->res = RES_OK;
break;
case DCR_HANDLE:
if(win->mode.as_int)
{
locked_set_byte(&win->mode0, FLG_OK);
svc_send_signal(&gui_task, SIG_GUI_TASK);
}
break;
case DCR_CANCEL:
if(win->mode.as_int)
{
// this is WINDOW handle...
locked_set_byte(&win->mode0, FLG_SIGNALED);
win->svc_list_cancel(drv_data->waiting);
} else
{
// not a WINDOW
if(win == drv_data->helper)
{
//the helper task is waiting for object...
drv_data->helper = NULL;
win->dst.as_voidptr = NULL;
svc_HND_SET_STATUS(win, RES_SIG_OK);
}
}
break;
}
}
开发者ID:bratkov,项目名称:tmos,代码行数:56,代码来源:gui_drv.cpp
示例5: DemoInit
//Set up variables
bool DemoInit()
{
if(!window.Init("Metaballs", 512, 512, 32, 24, 8, WINDOWED_SCREEN))
return 0; //quit if not created
//set up grid
if(!cubeGrid.CreateMemory())
return false;
if(!cubeGrid.Init(gridSize))
return false;
//set up metaballs
for(int i=0; i<numMetaballs; i++)
metaballs[i].Init(VECTOR3D(0.0f, 0.0f, 0.0f), 5.0f+float(i));
//Set Up Colors
diffuseColors[0].Set(0.345f, 0.843f, 0.902f, 1.0f);
diffuseColors[1].Set(0.047f, 0.839f, 0.271f, 1.0f);
diffuseColors[2].Set(0.976f, 0.213f, 0.847f, 1.0f);
//reset timer for start
timer.Reset();
return true;
}
开发者ID:,项目名称:,代码行数:26,代码来源:
示例6: WinMain
//ENTRY POINT FOR APPLICATION
//CALL WINDOW CREATION ROUTINE, DEAL WITH MESSAGES, WATCH FOR INTERACTION
int WINAPI WinMain( HINSTANCE hInstance, //instance
HINSTANCE hPrevInstance, //Previous Instance
LPSTR lpCmdLine, //command line parameters
int nCmdShow) //Window show state
{
//Initiation
errorLog.Init("Error Log.txt");
//init variables etc, then GL
if(!DemoInit())
{
errorLog.OutputError("Demo Initiation failed");
return 0;
}
else
errorLog.OutputSuccess("Demo Initiation Successful");
if(!GLInit())
{
errorLog.OutputError("OpenGL Initiation failed");
return 0;
}
else
errorLog.OutputSuccess("OpenGL Initiation Successful");
//Main Loop
for(;;)
{
if(!(window.HandleMessages())) break;//handle windows messages, quit if returns false
UpdateFrame();
RenderFrame();
}
DemoShutdown();
errorLog.OutputSuccess("Exiting...");
return (window.msg.wParam); //Exit The Program
}
开发者ID:,项目名称:,代码行数:40,代码来源:
示例7: def_await_event
DLLSYM WINDOW def_await_event( /*wait for event */
WINDOW win, /*window to wait on */
BOOL8 wait, /*waiting flag */
INT8 event_type, /*type to wait for */
GRAPHICS_EVENT *out_event /*output event */
) {
GRAPHICS_EVENT *event; /*return event */
INT16 fd; //file descriptor
if (win == NULL)
fd = 0;
else
fd = win->get_fd ();
/*look for one */
event = find_event (fd, wait, event_type);
if (event == NULL)
return NULL; /*not found */
else {
*out_event = *event; /*copy event */
if (event->type != DESTROY_EVENT)
delete event; //free the element
return out_event->fd;
}
}
开发者ID:jan-ruzicka,项目名称:tesseract-ocr-sf,代码行数:24,代码来源:evnts.cpp
示例8: WndAdminProc
extern "C" LONG ALMCALLBACK WndAdminProc(
OBJECTID oiWindow,
AObjMessage* theSystem)
{
WINDOW* wnd;
LONG rVal = A_NOTHANDLED;
switch(theSystem->message1)
{
case AOBJ_AWAKENED:
#ifdef AW_I_DEBUG
g_nLayoutUseCount++;
if (!g_hinstLayout)
{
I_ASSERT(g_nLayoutUseCount==1);
g_hinstLayout = LoadLibrary("ALM_WLAY.DLL");
ADBG_PRINT_I("Preloading Layout Editor");
}
#endif
rVal = A_OK;
break;
case AOBJ_CREATED:
#ifdef AW_I_DEBUG
g_nLayoutUseCount++;
if (!g_hinstLayout)
{
I_ASSERT(g_nLayoutUseCount==1);
g_hinstLayout = LoadLibrary("ALM_WLAY.DLL");
ADBG_PRINT_I("Preloading Layout Editor");
}
#endif
wnd = new(oiWindow) WINDOW(oiWindow); //The locks the data
delete wnd; //Just unlocks the data -- DOES NOT DELETE THE DATAS!!!
rVal = A_OK;
break;
case AOBJ_DESTROYED:
case AOBJ_ASLEEP:
#ifdef AW_I_DEBUG
g_nLayoutUseCount--;
if(g_nLayoutUseCount==0)
{
FreeLibrary(g_hinstLayout);
g_hinstLayout = NULL;
g_lpfnEditWnd = NULL;
g_lpfnItemFromUID = NULL;
ADBG_PRINT_I("Unloading Layout Editor");
}
#endif
rVal = A_CONTINUE;
break;
case AOBJ_ASSIGNOBJECT:
//Assignment of a window object is not yet defined
break;
case AOBJ_PREWRITE:
if (theSystem->message4 != /*AOBJ_PROJECTSAVE*/2)
{
wnd = LockWindowData(oiWindow);
I_VERIFY_POINTER(wnd, break);
if(wnd->PutItemsIntoDatas())
rVal = A_CONTINUE;
else
rVal = A_NOTHANDLED;
UnlockWindowData(oiWindow);
}
else
开发者ID:benbucksch,项目名称:AppWare,代码行数:70,代码来源:W_ADM.CPP
示例9: LoadCursor
void Edit::on_hover()
{
if(Mouse::is_over(get_position(), get_size()))
{
// change mouse cursor to I-beam
WINDOW * window = WINDOW::get_active();
if(window != nullptr)
{
#ifdef __windows__
HCURSOR ibeam = LoadCursor(nullptr, IDC_IBEAM);
SetClassLong(window->get_handle(), GCL_HCURSOR, (DWORD)ibeam); // DWORD = unsigned long
#endif
#ifdef __gnu_linux__
Cursor cursor = XCreateFontCursor(window->get_display(), XC_xterm);
XDefineCursor(window->get_display(), window->get_handle(), cursor);
XFreeCursor(window->get_display(), cursor);
#endif
}
} else { // revert back to original mouse cursor
WINDOW * window = WINDOW::get_active();
if(window != nullptr)
{
#ifdef __windows__
HCURSOR arrow = LoadCursor(nullptr, IDC_ARROW);
SetClassLong(window->get_handle(), GCL_HCURSOR, (DWORD)arrow);
#endif
#ifdef __gnu_linux__
Cursor cursor = XCreateFontCursor(window->get_display(), XC_left_ptr);
XDefineCursor(window->get_display(), window->get_handle(), cursor);
XFreeCursor(window->get_display(), cursor);
#endif
}
}
}
开发者ID:sidpoison,项目名称:dokun,代码行数:34,代码来源:edit.cpp
示例10: gui_thread
void gui_thread(GUI_DRIVER_INFO* drv_info)
{
unsigned int res, tmp, redraw;
WINDOW win;
WINDOW top;
WINDOW desktop; //main_dlg;
CHandle key_hnd;
CHandle gui_hnd;
//prevent these signals not to be used from task handles
ALLOCATE_SIGNAL(SIG_GUI_TASK);
//wait for static constructors (lcd object)
while(!detect_displays(drv_info))
tsk_sleep(10);
// start desktop
while( !(desktop = tsk_new_window(maindlg_cb)) )
{
tsk_sleep(10);
}
desktop->next = NULL;
top = desktop;
desktop->rect.x1 = drv_info->lcd[0]->size_x;
desktop->rect.y1 = drv_info->lcd[0]->size_y;
for(int i=0; i<GUI_DISPLAYS; i++)
{
if(drv_info->lcd[i])
{
#if GUI_DISPLAYS > 1
desktop->displays |= (1<<i);
#endif
drv_info->lcd[i]->lcd_init((GUI_CB)splashdlg_cb);
}
}
tsk_sleep(3000);
init_main_menu();
// start key handle
key_hnd.tsk_safe_open(KEY_DRV_INDX, 0);
key_hnd.src.as_int = 0;
key_hnd.tsk_start_read(&key_hnd.src.as_int, 1);
// start gui handle
gui_hnd.tsk_safe_open(GUI_DRV_INDX, 0); //mode = 1 - control handle
gui_hnd.tsk_start_read(NULL, 0);
for(;;)
{
res = tsk_wait_signal(-1u, 1000 - (CURRENT_TIME %1000));
redraw = res>>8;;
if(!res)
redraw = 0xFF;
// 1) get waiting objects
if(res & gui_hnd.signal)
{
drv_info->lcd[0]->backlight_signal();
gui_hnd.res &= ~FLG_SIGNALED;
win = (WINDOW)gui_hnd.dst.as_voidptr;
if(win)
{
top->next = win;
do
{
top = (WINDOW)top->next;
top->rect.x1 = desktop->rect.x1;
top->rect.y1 = desktop->rect.y1;
top->callback(NULL , WM_INIT);
#if GUI_DISPLAYS > 1
redraw |= top->displays;
#endif
} while( top->next );
}
gui_hnd.tsk_start_read(NULL, 0);
#if GUI_DISPLAYS == 1
redraw |= 1;
#endif
}
// 2) check keyboard
if(res & key_hnd.signal)
{
drv_info->lcd[0]->backlight_signal();
key_hnd.res &= ~FLG_SIGNALED;
//send to top
tmp = top->callback(key_hnd.src.as_int , WM_KEY);
if(tmp & FLG_BUSY) //FLG_BUSY returned to redraw
{
tmp ^= FLG_BUSY;
#if GUI_DISPLAYS > 1
redraw |= top->displays;
#else
//.........这里部分代码省略.........
开发者ID:bratkov,项目名称:tmos,代码行数:101,代码来源:gui_drv.cpp
示例11: c_clear_window
void c_clear_window( /*move pen */
void *win) {
WINDOW window = (WINDOW) win;
window->Clear_view_surface ();
}
开发者ID:jan-ruzicka,项目名称:tesseract-ocr-sf,代码行数:6,代码来源:callcpp.cpp
示例12: c_make_current
void c_make_current( /*move pen */
void *win) {
WINDOW window = (WINDOW) win;
window->Make_picture_current ();
}
开发者ID:jan-ruzicka,项目名称:tesseract-ocr-sf,代码行数:6,代码来源:callcpp.cpp
示例13: Update
void INTERACTOR::Update()
{
//update angles
if(window.isLeftButtonPressed())
{
leftRightRotation+=(window.GetMouseXMovement())*rotationSensitivity;
upDownRotation+=(window.GetMouseYMovement())*rotationSensitivity;
}
//update radius
if(window.isRightButtonPressed())
{
r+=(window.GetMouseYMovement())*(float)translationSensitivity;
}
//update position if there has been a change
if(window.isLeftButtonPressed() || window.isRightButtonPressed())
{
static MATRIX4X4 tempMatrix;
glPushMatrix();
glLoadIdentity();
glTranslatef(lookAt.x, lookAt.y, lookAt.z);
glRotated(-leftRightRotation, 0.0f, 1.0f, 0.0f);
glRotated(-upDownRotation, 1.0f, 0.0f, 0.0f);
glTranslatef(0.0f, 0.0f, r);
glGetFloatv(GL_MODELVIEW_MATRIX, tempMatrix);
position=tempMatrix.GetColumn(3);
glPopMatrix();
}
}
开发者ID:,项目名称:,代码行数:30,代码来源:
示例14: UpdateFrame
//Perform per frame updates
void UpdateFrame()
{
window.Update();
camera.Update();
//Change object type
if(window.isKeyPressed(' '))
{
++objectType;
if(objectType==3)
objectType=0;
window.SetKeyReleased(' ');
}
//Change render path
if(window.isKeyPressed('1') && renderPath!=CHROMATIC_SINGLE && pathOneSupported)
{
renderPath=CHROMATIC_SINGLE;
InitChromaticSingleStates();
}
if(window.isKeyPressed('2') && renderPath!=SIMPLE_SINGLE)
{
renderPath=SIMPLE_SINGLE;
InitSimpleSingleStates();
}
if(window.isKeyPressed('3') && renderPath!=CHROMATIC_TWIN)
{
renderPath=CHROMATIC_TWIN;
//Set States every pass, as it is a 2 pass algorithm
}
}
开发者ID:,项目名称:,代码行数:35,代码来源:
示例15: DemoShutdown
void DemoShutdown()
{
pbuffer.Shutdown();
window.Shutdown(); //Shutdown window
}
开发者ID:,项目名称:,代码行数:6,代码来源:
示例16: RenderFrame
//draw a frame
void RenderFrame()
{
//Draw to pbuffer
pbuffer.MakeCurrent();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity(); //reset modelview matrix
gluLookAt( 0.0f, 0.0f, 4.0f,
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f);
//Draw scene
if(drawTextured)
{
glBindTexture(GL_TEXTURE_2D, decalTexture);
glEnable(GL_TEXTURE_2D);
glPushMatrix();
glRotatef(timer.GetTime()/20, 0.0f, 1.0f, 0.0f);
glutSolidTeapot(0.8f);
glPopMatrix();
glDisable(GL_TEXTURE_2D);
}
else
{
glPushMatrix();
glRotatef(timer.GetTime()/20, 0.0f, 1.0f, 0.0f);
glRotatef(55.0f, 1.0f, 0.0f, 0.0f);
glutWireTorus(0.3f, 1.0f, 12, 24);
glPopMatrix();
glPushMatrix();
glRotatef(timer.GetTime()/20, 0.0f, 1.0f, 0.0f);
glRotatef(-55.0f, 1.0f, 0.0f, 0.0f);
glutWireTorus(0.3f, 1.0f, 12, 24);
glPopMatrix();
}
//Draw to window
window.MakeCurrent();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
camera.SetupViewMatrix();
glLoadMatrixf(camera.viewMatrix);
glBindTexture(GL_TEXTURE_2D, pbufferTexture);
//use the pbuffer as the texture
wglBindTexImageARB(pbuffer.hBuffer, WGL_FRONT_LEFT_ARB);
//Draw simple rectangle
glBegin(GL_TRIANGLE_STRIP);
{
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-1.0f, 1.0f, 0.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f( 1.0f, -1.0f, 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f( 1.0f, 1.0f, 0.0f);
}
glEnd();
//release the pbuffer for further rendering
wglReleaseTexImageARB(pbuffer.hBuffer, WGL_FRONT_LEFT_ARB);
fpsCounter.Update(); //update frames per second counter
glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
window.StartTextMode();
window.Print(0, 28, "FPS: %.2f", fpsCounter.GetFps()); //print the fps
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
window.Print(0, 48, "%dx Anisotropy", currentAnisotropy);
glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
window.Print(0, 68, "%s", useMipmapFilter ? "LINEAR_MIPMAP_LINEAR filtering" :
"LINEAR filtering");
window.EndTextMode();
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
if(window.isKeyPressed(VK_F1))
{
window.SaveScreenshot();
window.SetKeyReleased(VK_F1);
}
window.SwapBuffers(); //swap buffers
//check for any opengl errors
window.CheckGLError();
//quit if necessary
if(window.isKeyPressed(VK_ESCAPE))
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:
示例17: GLInit
//Set up openGL
bool GLInit()
{
//Set up for pbuffer
pbuffer.MakeCurrent();
//set viewport
glViewport(0, 0, pbufferSize, pbufferSize);
//set up projection matrix
glMatrixMode(GL_PROJECTION); //select projection matrix
glLoadIdentity(); //reset
gluPerspective(45.0f, 1.0f, 1.0f, 100.0f);
//load identity modelview
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//other states
//shading
glShadeModel(GL_SMOOTH);
glClearColor( pbufferBackgroundColor.r,
pbufferBackgroundColor.g,
pbufferBackgroundColor.b,
pbufferBackgroundColor.a);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
//depth
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
//hints
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
//Set up for window
window.MakeCurrent();
//set viewport
int height;
if (window.height==0)
height=1;
else
height=window.height;
glViewport(0, 0, window.width, height); //reset viewport
//set up projection matrix
glMatrixMode(GL_PROJECTION); //select projection matrix
glLoadIdentity(); //reset
gluPerspective(45.0f, (GLfloat)window.width/(GLfloat)height, 1.0f, 100.0f);
//load identity modelview
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//other states
//shading
glShadeModel(GL_SMOOTH);
glClearColor( windowBackgroundColor.r,
windowBackgroundColor.g,
windowBackgroundColor.b,
windowBackgroundColor.a);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
//depth
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
//hints
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glEnable(GL_TEXTURE_2D);
return true;
}
开发者ID:,项目名称:,代码行数:82,代码来源:
注:本文中的WINDOW类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论