Exemplo n.º 1
0
/*!
@brief コンストラクタ(通常)
@par   関数説明
変数を初期化する。
*/
Window::Window( void )
{
	wd.wcx.cbSize = sizeof( WNDCLASSEX );
	wd.wcx.hIcon = wd.wcx.hIconSm = NULL;
	strcpy_s( CLASSNAME, WBUFLEN, MIKANCLASSNAME );
	//クラスネームの設定
	wd.wcx.lpszClassName = TEXT( MIKANCLASSNAME );//SetClassNameEx( "MikanWindow" );
	//ウィンドウの名前の設定
	SetWindowName( "Window" );//TEXT( __FILE__ )
	//wd.wc.lpszClassName = wd.ClassName;
	//ウィンドウスタイルの設定
	SetWindowStyle( WT_DEFAULT );
	//拡張ウィンドウスタイルの設定
	SetWindowStyleExDirect( NULL );
	//ウィンドウを標準の位置に設定
	SetPositionXY( 0, 0 );//CW_USEDEFAULT, CW_USEDEFAULT );
	//ウィンドウサイズを640*480に設定
	//  SetWindowSize( WF_WIDTH  + GetSystemMetrics(SM_CXEDGE) + GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(SM_CXDLGFRAME),
	//                 WF_HEIGHT + GetSystemMetrics(SM_CYEDGE) + GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYDLGFRAME) + GetSystemMetrics(SM_CYCAPTION));
	SetScreenSize( WF_WIDTH, WF_HEIGHT );
	//ウィンドウハンドルの設定
	SetWindowHandle( NULL );
	SetParentWindowHandle( NULL );
	//  SetWindowClass( NULL );
	wd.Screen = NULL;
	wd.hMenu = NULL;
	wd.hInstance = NULL;
	wd.lpParam = NULL;
	drophandle = NULL;
	dragfilesmax = 0;
	ReceiveDragFiles_ = NULL;
	dragfilepath[ 0 ] = '\0';
	fullscreen = 0;
}
Exemplo n.º 2
0
Camera::Camera(int width, int height)
	: _dragging(false),
	  _rotation(CM::Mat3::Identity()),
	  _dragRot(CM::Mat3::Identity())
{
	SetScreenSize(width, height);
}
Exemplo n.º 3
0
Screen::Screen(int width, int height)
{
	SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_EVENTS);
    this->ScreenSurface = NULL;
    this->buffer = NULL;
    this->Transparent = false;
    this->FontFile = NULL;

	this->MainWnd = SDL_CreateWindow(VERSION, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_SHOWN);
	if(this->MainWnd == NULL)
	{
		Error("Window could not be created! SDL_Error: %s\n", SDL_GetError());
		SDL_Quit();
		return ;
	}
	if (TTF_Init() == -1)
	{
		Error("Initialize ttf failure");
	} else {
		SetFont(0);
		SetScreenSize(width, height);
#ifndef __linux__
		this->DebugFont = TTF_OpenFont("C:\\Windows\\Fonts\\CONSOLA.TTF", 12);
#else
		this->DebugFont = TTF_OpenFont("/system/fonts/DroidSansMono.ttf", 12);
#endif

		this->TextColor = SDL_MapRGB(this->ScreenSurface->format, 0xFF, 0xFF, 0xFF);
		this->BackgroundColor = SDL_MapRGB(this->ScreenSurface->format, 0x00, 0x00, 0x00);
	}
}
Exemplo n.º 4
0
bool CDisplayDlg::Init( int width,int height )
{
    SetScreenSize(width,height);
    m_IsFullScreen	= false;

    return true;
}
Exemplo n.º 5
0
 TestProjection() {
     SetScreenOrigin(0, 0);
     SetScale(fixed(640) / (fixed(100) * 2));
     SetGeoLocation(GeoPoint(Angle::Degrees(fixed(7.7061111111111114)),
                             Angle::Degrees(fixed(51.051944444444445))));
     SetScreenSize(640, 480);
     UpdateScreenBounds();
 }
Exemplo n.º 6
0
		void Renderer::Initialize()
		{
			SetScreenSize(callback::GetScreenSize());
			InitializeDevice();
			GetTextRenderer()->Initialize();
			GetCamera()->Initialize(GetGlobalInstance()->GetDeviceInformation());
			GetLight()->Initialize(GetGlobalInstance()->GetDeviceInformation());
			GetSprite()->Initialize(GetGlobalInstance()->GetDeviceInformation());
		}
Exemplo n.º 7
0
CDisplayDlg::CDisplayDlg(CWnd* pParent /*=NULL*/)
    : CDialog(CDisplayDlg::IDD, pParent)
{
    SetScreenSize(1024,768);
    m_IsFullScreen = false;
    m_cx  = 0;
    m_cy  = 0;
    m_ScreenDisplayer = NULL;
}
Exemplo n.º 8
0
        /**
         * @param width Screen width.
         * @param height Screen height.
         * @param offset_x X offset.
         * @param offset_y Y offset.
         */
        SpriteManager(ScreenHandler::Size width, ScreenHandler::Size height,
            ScreenHandler::P offset_x = 0, ScreenHandler::P offset_y = 0)
        {
            SetScreenSize(width, height);
            SetScreenOffset(offset_x, offset_y);

            Register();
            Load();

            log_info("[Spr]\tSprite manager initialized.");
        }
Exemplo n.º 9
0
		void PostEffect::Init(GLuint width, GLuint height)
		{
			ClearFX();

			vector<GLfloat> screenVertices;
			screenVertices.push_back(0.0f);
			screenVertices.push_back(0.0f);
			screenVertices.push_back(0.0f);
			screenVertices.push_back(0.0f);

			screenVertices.push_back(1.0f);
			screenVertices.push_back(0.0f);
			screenVertices.push_back(1.0f);
			screenVertices.push_back(0.0f);

			screenVertices.push_back(1.0f);
			screenVertices.push_back(1.0f);
			screenVertices.push_back(1.0f);
			screenVertices.push_back(1.0f);

			screenVertices.push_back(0.0f);
			screenVertices.push_back(1.0f);
			screenVertices.push_back(0.0f);
			screenVertices.push_back(1.0f);

			vector<GLushort> screenIndices;
			screenIndices.push_back(0);
			screenIndices.push_back(1);
			screenIndices.push_back(2);

			screenIndices.push_back(0);
			screenIndices.push_back(2);
			screenIndices.push_back(3);

			GL_CHECK( glGenBuffers(1,&s_screenVertexBuffer) );
			GL_CHECK( glBindBuffer(GL_ARRAY_BUFFER,s_screenVertexBuffer) );
			GL_CHECK( glBufferData(GL_ARRAY_BUFFER,sizeof(GLfloat)*screenVertices.size(),&screenVertices[0],GL_STATIC_DRAW) );
			GL_CHECK( glBindBuffer(GL_ARRAY_BUFFER,0) );

			GL_CHECK( glGenBuffers(1,&s_screenIndexBuffer) );
			GL_CHECK( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,s_screenIndexBuffer) );
			GL_CHECK( glBufferData(GL_ELEMENT_ARRAY_BUFFER,sizeof(GLushort)*screenIndices.size(),&screenIndices[0],GL_STATIC_DRAW) );
			GL_CHECK( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0) );

			s_screenIndexCount=screenIndices.size();
	
			SetScreenSize(width,height);

			FXAAII = new PostEffect(FXAAII_Shader);
			FXAAI = new PostEffect(FXAAI_Shader);
		}
Exemplo n.º 10
0
void UVaQuoleHUDComponent::InitializeComponent()
{
	Super::InitializeComponent();

	SetScreenPosition(0.f, 0.f);
	SetScreenSize(Width, Height);

	// Register page with Viewport Client to receive input
	if (GEngine && GEngine->GameViewport)
	{
		UVaQuoleUIViewportClient* ViewportClient = Cast<UVaQuoleUIViewportClient>(GEngine->GameViewport);
		if (ViewportClient)
		{
			ViewportClient->RegisterHudUI(this);
		}
	}
}
Exemplo n.º 11
0
/* This method is use the old, opengl 2.0 context creation method */
void CreateSceneCompatible(int width, int height, int mode) {
    int conf[] = {GLX_DOUBLEBUFFER, True,
                  GLX_RGBA,
                  GLX_DEPTH_SIZE, 12,
                  GLX_RED_SIZE, 1,
                  GLX_BLUE_SIZE, 1,
                  GLX_GREEN_SIZE, 1,
                  None
                 };
    XSetWindowAttributes  swa;
    XVisualInfo          *visual;
    Atom                  fullscreen;

    cg_display       = XOpenDisplay(NULL);
    visual        = glXChooseVisual(cg_display, DefaultScreen(cg_display), conf);
    cg_screen_mode   = mode;

    cg_context       = glXCreateContext(cg_display, visual, NULL, True);
    swa.colormap     = XCreateColormap(cg_display, RootWindow(cg_display, visual->screen), visual->visual, AllocNone);
    swa.border_pixel = 0;
    swa.event_mask   = ExposureMask | StructureNotifyMask |
                       ButtonPressMask | Button1MotionMask | KeyPressMask;
    cg_window        = XCreateWindow(cg_display, RootWindow(cg_display, visual->screen),
                                     0, 0, width, height, 0, visual->depth, InputOutput,
                                     visual->visual, CWBorderPixel | CWColormap | CWEventMask, &swa);

    if(mode == CG_FULLSCREEN) {
        /* Set to fullscreen */
        fullscreen = XInternAtom(cg_display, "_NET_WM_STATE_FULLSCREEN", False);
        XChangeProperty(cg_display, cg_window, XInternAtom(cg_display, "_NET_WM_STATE", False),
                        XA_ATOM, 32, PropModeReplace,
                        (unsigned char *)&fullscreen, 1);

        HideCursor();
        /* Get the current screen size and set the new one */
        SetScreenSize(width, height, visual);
    }

    glXMakeCurrent(cg_display, cg_window, cg_context);
    XMapWindow(cg_display, cg_window);
}
Exemplo n.º 12
0
InexorCefApp::InexorCefApp(std::string instance_id, std::string host, std::string port, int width, int height)
{
    Log.ui->info("init: cef: construct InexorCefApp (dimensions: {}x{})", width, height);

    context_manager = new context::InexorContextManager();

    layer_manager = new layer::InexorLayerManager(width, height);
    context_manager->AddSubContext(layer_manager);

    mouse_manager = new input::InexorMouseManager(layer_manager, width, height);
    context_manager->AddSubContext(mouse_manager);

    keyboard_manager = new input::InexorKeyboardManager(layer_manager);
    context_manager->AddSubContext(keyboard_manager);

    SetScreenSize(width, height);

    InitHudLayer(instance_id, host, port);
    InitConsoleLayer(instance_id, host, port);
    InitAppLayer(instance_id, host, port);
}
Exemplo n.º 13
0
InexorCefApp::InexorCefApp(int width, int height)
{
    context_manager = new InexorCefContextManager();

    layer_manager = new InexorCefLayerManager(width, height);
    context_manager->AddSubContext(layer_manager);

    mouse_manager = new InexorCefMouseManager(layer_manager);
    context_manager->AddSubContext(mouse_manager);

    keyboard_manager = new InexorCefKeyboardManager(layer_manager);
    context_manager->AddSubContext(keyboard_manager);

    frame = new InexorCefFrame();
    context_manager->AddSubContext(frame);
    layer_manager->AddLayerProvider(frame);

    SetScreenSize(width, height);

    mouse_manager->Show();
}
Exemplo n.º 14
0
//---------------------------------------------------------------------
void CZoomCtrl::Draw(CDC *pDC)
{
	// fill background
	//COLORREF backgrColor = RGB(255,255,192);
	CRect rClient;
	GetClientRect(rClient);
	
	SetScreenSize(rClient);
	//pDC->FillRect(&rClient, &CBrush(backgrColor));

	// define virtual drawing space -- change this to suit
	// if drawing must not distort, then create a rect same shape as rClient
	//CRect rVirt(0, 0, 5000, 5000);
	PrepDC(pDC);//, rVirt, rClient);

	// do your drawing here, in virtual coords

	// define virtual drawing space -- change this to suit
	// if drawing must not distort, then create a rect same shape as rClient
	//PrepDC(pDC);//, rVirt, rClient);

	GetWorkpad()->GetImage().Draw(pDC->GetSafeHdc(), rClient.left, rClient.top);
	GetWorkpad()->DrawObjects(pDC);
}
Exemplo n.º 15
0
/*
   This method create a new glx based context
   creation method to create opengl 4.1 context
*/
int CreateScene(int width, int height, int mode) {
    int conf[] = {GLX_DOUBLEBUFFER, True,
                  GLX_DEPTH_SIZE, 12,
                  GLX_RED_SIZE,    4,
                  GLX_BLUE_SIZE,   4,
                  GLX_GREEN_SIZE,  4,
                  GLX_ALPHA_SIZE,  4,
                  None
                 };

    int gl4attr[] = {GLX_CONTEXT_MAJOR_VERSION_ARB, 4, /* OpenGL major version number */
                     GLX_CONTEXT_MINOR_VERSION_ARB, 1, /* OpenGL minor version number */
                     GLX_CONTEXT_FLAGS_ARB,
                     GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
                     None
                    };

    GLXFBConfig *fbc;
    int fbcount;
    XSetWindowAttributes swa;
    XVisualInfo *visual;
    Atom fullscreen;

    cg_display = XOpenDisplay(NULL);
    fbc = glXChooseFBConfig(cg_display, DefaultScreen(cg_display), conf, &fbcount);
    if(!fbc) {
        return(-1);
    }

    visual            = glXGetVisualFromFBConfig(cg_display, fbc[0]);
    if(!visual) {
        return(-1);
    }
    swa.background_pixel = 0;
    swa.border_pixel     = 0;
    swa.colormap         = XCreateColormap(cg_display, RootWindow(cg_display, visual->screen),
                                           visual->visual, AllocNone);
    swa.event_mask       = StructureNotifyMask | ExposureMask | KeyPressMask;
    cg_window            = XCreateWindow(cg_display, RootWindow(cg_display, visual->screen),
                                         0, 0, width, height, 0, visual->depth, InputOutput,
                                         visual->visual, CWBorderPixel | CWColormap | CWEventMask, &swa);
    if(!cg_window) {
        return(-1);
    }
    cg_context           = glXCreateContextAttribsARB(cg_display, fbc[0], NULL, True, gl4attr);

    if(mode == CG_FULLSCREEN) {
        /* Set to fullscreen */
        fullscreen = XInternAtom(cg_display, "_NET_WM_STATE_FULLSCREEN", False);
        XChangeProperty(cg_display, cg_window, XInternAtom(cg_display, "_NET_WM_STATE", False),
                        XA_ATOM, 32, PropModeReplace,
                        (unsigned char *)&fullscreen, 1);
        HideCursor();
        /* Get the current screen size and set the new one */
        SetScreenSize(width, height, visual);
    }

    cg_screen_mode = mode;
    XMapWindow(cg_display, cg_window);
    glXMakeCurrent(cg_display, cg_window, cg_context);

    free(fbc);
    XFree(visual);
    return(0);
}
Exemplo n.º 16
0
ArcBall::ArcBall (double w, double h) {
	SetScreenSize(w,h);
}
//-----------------------------------------------------------------------------
// Purpose: Called when the DLL is first loaded.
// Input  : engineFactory - 
// Output : int
//-----------------------------------------------------------------------------
int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physicsFactory, CGlobalVarsBase *pGlobals )
{
	InitCRTMemDebug();
	MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f );

	// Hook up global variables
	gpGlobals = pGlobals;

	// We aren't happy unless we get all of our interfaces.
	if(
		!(engine = (IVEngineClient *)appSystemFactory( VENGINE_CLIENT_INTERFACE_VERSION, NULL )) ||
		!(modelrender = (IVModelRender *)appSystemFactory( VENGINE_HUDMODEL_INTERFACE_VERSION, NULL )) ||
		!(effects = (IVEfx *)appSystemFactory( VENGINE_EFFECTS_INTERFACE_VERSION, NULL )) ||
		!(cvar = (ICvar *)appSystemFactory( VENGINE_CVAR_INTERFACE_VERSION, NULL )) ||
		!(enginetrace = (IEngineTrace *)appSystemFactory( INTERFACEVERSION_ENGINETRACE_CLIENT, NULL )) ||
		!(render = (IVRenderView *)appSystemFactory( VENGINE_RENDERVIEW_INTERFACE_VERSION, NULL )) ||
		!(debugoverlay = (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL )) ||
		!(materials = (IMaterialSystem *)appSystemFactory( MATERIAL_SYSTEM_INTERFACE_VERSION, NULL )) ||
		!(engineCache = (IVEngineCache*)appSystemFactory(VENGINE_CACHE_INTERFACE_VERSION, NULL )) ||
		!(modelinfo = (IVModelInfo *)appSystemFactory(VMODELINFO_CLIENT_INTERFACE_VERSION, NULL )) ||
		!(netgraph = (INetGraph *)appSystemFactory(VNETGRAPH_INTERFACE_VERSION, NULL )) ||
		!(enginevgui = (IEngineVGui *)appSystemFactory(VENGINE_VGUI_VERSION, NULL )) ||
		!(networkstringtable = (INetworkStringTableClient *)appSystemFactory(INTERFACENAME_NETWORKSTRINGTABLECLIENT,NULL)) ||
		!(partition = (ISpatialPartition *)appSystemFactory(INTERFACEVERSION_SPATIALPARTITION, NULL)) ||
		!(shadowmgr = (IShadowMgr *)appSystemFactory(ENGINE_SHADOWMGR_INTERFACE_VERSION, NULL)) ||
		!(staticpropmgr = (IStaticPropMgrClient *)appSystemFactory(INTERFACEVERSION_STATICPROPMGR_CLIENT, NULL)) ||
		!(enginesound = (IEngineSound *)appSystemFactory(IENGINESOUND_CLIENT_INTERFACE_VERSION, NULL)) ||
		!(filesystem = (IFileSystem *)appSystemFactory(FILESYSTEM_INTERFACE_VERSION, NULL)) ||
		!(random = (IUniformRandomStream *)appSystemFactory(VENGINE_CLIENT_RANDOM_INTERFACE_VERSION, NULL)) ||
		!(gameuifuncs = (IGameUIFuncs * )appSystemFactory( VENGINE_GAMEUIFUNCS_VERSION, NULL )) ||
		!(gameeventmanager = (IGameEventManager *)appSystemFactory(INTERFACEVERSION_GAMEEVENTSMANAGER,NULL))
		)
	{
		return false;
	}

	g_pMaterialSystemHardwareConfig = materials->GetHardwareConfig( MATERIALSYSTEM_HARDWARECONFIG_INTERFACE_VERSION, NULL );
	if( !g_pMaterialSystemHardwareConfig )
	{
		return false;
	}

	SetScreenSize();

	// Hook up the gaussian random number generator
	s_GaussianRandomStream.AttachToStream( random );

	// Initialize the console variables.
	ConCommandBaseMgr::OneTimeInit(&g_ConVarAccessor);

	if(!Initializer::InitializeAllObjects())
		return false;

	if(!g_ParticleMgr.Init(8192, materials))
		return false;

	// load used game events  
	gameeventmanager->LoadEventsFromFile("resource/gameevents.res");

	if(!VGui_Startup( appSystemFactory ))
		return false;

	g_pMatSystemSurface = (IMatSystemSurface*)vgui::surface()->QueryInterface( MAT_SYSTEM_SURFACE_INTERFACE_VERSION ); 
	if (!g_pMatSystemSurface)
		return false;

	// Add the client systems.	
	
	// Client Leaf System has to be initialized first, since DetailObjectSystem uses it
	IGameSystem::Add( GameStringSystem() );
	IGameSystem::Add( ClientLeafSystem() );
	IGameSystem::Add( DetailObjectSystem() );
	IGameSystem::Add( ViewportClientSystem() );
	IGameSystem::Add( ClientEffectPrecacheSystem() );
	IGameSystem::Add( g_pClientShadowMgr );
	IGameSystem::Add( ClientThinkList() );
	IGameSystem::Add( ClientSoundscapeSystem() );

#if defined( CLIENT_DLL ) && defined( COPY_CHECK_STRESSTEST )
	IGameSystem::Add( GetPredictionCopyTester() );
#endif

	modemanager->Init( );

	gHUD.Init();

	g_pClientMode->Init();

	if( !IGameSystem::InitAllSystems() )
		return false;

	g_pClientMode->Enable();

	view->Init();
	vieweffects->Init();

	C_BaseTempEntity::PrecacheTempEnts();

	input->Init_All();

	VGui_CreateGlobalPanels();

	InitSmokeFogOverlay();

	C_TerrainMod_Init();

	// Register user messages..
	CUserMessageRegister::RegisterAll();

	ClientVoiceMgr_Init();

	// Embed voice status icons inside chat element
	{
		CHudChat *chatElement = GET_HUDELEMENT( CHudChat );
		vgui::VPANEL parent = enginevgui->GetPanel( PANEL_CLIENTDLL );
		if ( chatElement )
		{
			parent = chatElement->GetVoiceArea()->GetVPanel();
		}
		
		GetClientVoiceMgr()->Init( &g_VoiceStatusHelper, parent );
	}

	if ( !PhysicsDLLInit( physicsFactory ) )
		return false;

	g_pGameSaveRestoreBlockSet->AddBlockHandler( GetEntitiySaveRestoreBlockHandler() );
	g_pGameSaveRestoreBlockSet->AddBlockHandler( GetPhysSaveRestoreBlockHandler() );

	return true;
}
Exemplo n.º 18
0
// -----------------------------------------------------------------------------
// CRain::AppInit
// Application initialization code.
// -----------------------------------------------------------------------------
//
void CRain::AppInitL( void )
    {
    // Construct a texture manager that uses the application's private
    // directory as the location for all textures.
    iTextureManager = CTextureManager::NewL ( iScreenWidth, iScreenHeight,
	                                            FRUSTUM_TOP, FRUSTUM_BOTTOM, FRUSTUM_RIGHT, FRUSTUM_LEFT, FRUSTUM_NEAR,
                                              this );

    // Initialize viewport and projection.
    SetScreenSize( iScreenWidth, iScreenHeight );

    /* Set the screen background color. */
    glClearColor( 0.f, 0.f, 0.f, 1.f );

    /* Enable back face culling. */
    glEnable( GL_CULL_FACE  );
    glEnable( GL_TEXTURE_2D );
    glEnable( GL_DEPTH_TEST );

    //Enable alpha test for color keying.
    glEnable( GL_ALPHA_TEST );
    glAlphaFunc( GL_GREATER, 0.0f );

    /*Disable lighting */
    glDisable( GL_LIGHTING );

	/* Enable vertex arrays. */
	glEnableClientState( GL_VERTEX_ARRAY );
    /* Enable texture arrays. */
	glEnableClientState( GL_TEXTURE_COORD_ARRAY );

    glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR);

	glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );

	iCloudTextureCoords[0] = 0; iCloudTextureCoords[1] = 1;
	iCloudTextureCoords[2] = 0; iCloudTextureCoords[3] = 0;
	iCloudTextureCoords[4] = 1; iCloudTextureCoords[5] = 0;
	iCloudTextureCoords[6] = 1; iCloudTextureCoords[7] = 1;

	iRainfall = CRainfall::NewL( 1000, TVector(0, 80, -(FRUSTUM_FAR+FRUSTUM_NEAR)/2), 120, (FRUSTUM_FAR-FRUSTUM_NEAR), 0);

	iCamera.LookAt(TVector(0, 30.0f, 0), TVector(0, 0, -(FRUSTUM_FAR+FRUSTUM_NEAR)/2), TVector(0, 1, 0));

    // Defining a color key interval for the tree texture.
	TUint8 MinColor[] = { 50, 0, 50};
	TUint8 MaxColor[] = { 200, 0, 200};

	// Pushing the textures into the loading queue.
	_LIT(KTreeName, "tree.gif");
	_LIT(KGrassName, "grass.jpg");
	_LIT(KCloudName, "cloud.jpg");

	iTextureManager->RequestToLoad(KTreeName , &iTreeTexture, MinColor, MaxColor );
	iTextureManager->RequestToLoad(KGrassName, &iGrassTexture );
	iTextureManager->RequestToLoad(KCloudName, &iCloudTexture );

	//Start to load the textures.
	iTextureManager->DoLoadL();
	}
Exemplo n.º 19
0
// -----------------------------------------------------------------------------
// CSimpleCubePbuffer::AppInit
//
// Initializes OpenGL ES, sets the vertex and color arrays and pointers,
// and selects the shading mode.
// -----------------------------------------------------------------------------
//
void CSimpleCubePbuffer::AppInit( void )
    {
    // Initialize viewport, projection and OpenGL state.
		SetScreenSize( iScreenWidth, iScreenHeight );
    }
Exemplo n.º 20
0
HVNC VNCCreateServer(HVNC_INITIALIZE *lpVNCInit)
{
    if (!bHVNCInit)
        return -1;

    HVNC hVNC=1;
    EnterCriticalSection(&csHVNC);
    {
        HVNC_HANDLE *lpHandle=NULL;
        DWORD dwHash=chksum_crc32((byte*)lpVNCInit->szDeskName,lstrlenA(lpVNCInit->szDeskName));
        if (!lpHandles)
            lpHandle=lpHandles=(HVNC_HANDLE*)MemAlloc(sizeof(HVNC_HANDLE));
        else
        {
            lpHandle=lpHandles;
            HVNC_HANDLE *lpPrev;
            while (lpHandle)
            {
                if (lpHandle->lpServer->Names.dwHash == dwHash)
                {
                    LeaveCriticalSection(&csHVNC);
                    return -1;
                }
                lpPrev=lpHandle;
                lpHandle=lpHandle->lpNext;
            }
            lpHandle=lpPrev->lpNext=(HVNC_HANDLE*)MemAlloc(sizeof(HVNC_HANDLE));
            lpHandle->lpPrev=lpPrev;
            hVNC=lpPrev->hHandle+1;
        }
        PHVNC lpServer=lpHandle->lpServer=(PHVNC)VirtualAlloc(NULL,sizeof(HVNCS),MEM_COMMIT,PAGE_READWRITE);
        lpHandle->hHandle=hVNC;
        InitializeCriticalSection(&lpServer->ThreadsInfo.csThreads);
        InitializeCriticalSection(&lpServer->WndWatcherInfo.csWndsList);
        lpServer->EventsInfo.dwSleep=50;

        lstrcpyA(lpServer->DeskInfo.szDeskName,lpVNCInit->szDeskName);
        lpServer->DeskInfo.dwFlags=lpVNCInit->dwFlags;
#ifdef _HVNC_WEBCAM
        if (!memcmp(lpVNCInit->szDeskName,"#webcam",sizeof("#webcam")-1))
        {
            lpServer->DeskInfo.bWebCam=true;

            lpServer->DeskInfo.dwFlags|=HVNC_WEB_CAM;
            if (!InitWebCam(lpServer))
            {
                 LeaveCriticalSection(&csHVNC);
                 VNCCloseHandle(lpHandle->hHandle);
                 return -1;
            }
        }
        else
#endif
        {
            HDESK hInputDesktop=OpenInputDesktop(0,FALSE,DESKTOP_READOBJECTS);
            if (hInputDesktop)
            {
                char szInputDesktopName[100];
                GetUserObjectInformationA(hInputDesktop,UOI_NAME,szInputDesktopName,sizeof(szInputDesktopName),NULL);
                if (!lstrcmpiA(szInputDesktopName,lpVNCInit->szDeskName))
                {
                    lpServer->DeskInfo.bInputDesktop=true;
                    lpServer->DeskInfo.dwFlags|=HVNC_INPUT_DESKTOP;
                }
                CloseDesktop(hInputDesktop);
            }

            if (lpServer->DeskInfo.dwFlags & HVNC_SCREEN_SIZE_DETERMINED)
            {
                if ((!lpVNCInit->bBitsPerPixel) || (!lpVNCInit->dwHeight) || (!lpVNCInit->dwWidth))
                {
                     LeaveCriticalSection(&csHVNC);
                     VNCCloseHandle(lpHandle->hHandle);
                     return -1;
                }
                SetScreenSize(lpServer,lpVNCInit->dwHeight,lpVNCInit->dwWidth,lpVNCInit->bBitsPerPixel);
            }
        }

        lpServer->Names.dwHash=dwHash;
        InitGlobalDataNames(lpServer);
        if (!InitGlobalData(lpServer))
        {
            LeaveCriticalSection(&csHVNC);
            VNCCloseHandle(lpHandle->hHandle);
            return -1;
        }

        lpServer->lpClientGoneHook=lpVNCInit->lpClientGoneHook;
        lpServer->lpNewClientHook=lpVNCInit->lpNewClientHook;

        if (!(lpServer->DeskInfo.dwFlags & HVNC_NO_INJECTS))
        {
            lstrcpyA(lpServer->lpGlobalVNCData->szDeskName,lpServer->DeskInfo.szDeskName);
            lpServer->lpGlobalVNCData->dwDeskFlags=lpVNCInit->dwFlags;

            WaitForSingleObject(hHandlesMutex,INFINITE);
                for (int i=0; i < HVNC_MAX_HANDLES; i++)
                {
                    if (!lpHandlesMapping[i])
                    {
                        lpHandlesMapping[i]=lpServer->Names.dwHash;
                        break;
                    }
                }
            ReleaseMutex(hHandlesMutex);
        }
    }
    LeaveCriticalSection(&csHVNC);
    return hVNC;
}
Exemplo n.º 21
0
void UVaQuoleHUDComponent::Resize(int32 NewWidth, int32 NewHeight)
{
	Super::Resize(NewWidth, NewHeight);

	SetScreenSize(Width, Height);
}
Exemplo n.º 22
0
 void SetMapRect(const PixelRect &rc) {
   SetScreenSize(rc.right - rc.left, rc.bottom - rc.top);
 }