Ejemplo n.º 1
0
// Draw the area that will be affected.
void LLToolBrushLand::render()
{
	if(mGotHover)
	{
		//llinfos << "LLToolBrushLand::render()" << llendl;
		LLVector3d spot;
		if(gViewerWindow->mousePointOnLandGlobal(mMouseX, mMouseY, &spot))
		{
			spot.mdV[VX] = floor( spot.mdV[VX] + 0.5 );
			spot.mdV[VY] = floor( spot.mdV[VY] + 0.5 );

			mBrushSize = gSavedSettings.getF32("LandBrushSize");
			
			region_list_t regions;
			determineAffectedRegions(regions, spot);

			// Now, for each region, render the overlay
			LLVector3 pos_world = gAgent.getRegion()->getPosRegionFromGlobal(spot);
			for(region_list_t::iterator iter = regions.begin();
				iter != regions.end(); ++iter)
			{
				LLViewerRegion* region = *iter;
				renderOverlay(region->getLand(), 
							  region->getPosRegionFromGlobal(spot),
							  pos_world);
			}
		}
		mGotHover = FALSE;
	}
}
Ejemplo n.º 2
0
		void CheckBox::render() {
			if (parent == NULL) { preRender(); }
			renderBackground();
			if (m_checked) { renderTick(); }
			renderOverlay();
			if (parent == NULL) { postRender(); }
		}
Ejemplo n.º 3
0
/**
 * Draw overlays
 */
void FWRenderer::drawOverlays() {
	Common::List<overlay>::iterator it;

	for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it) {
		renderOverlay(it);
	}
}
Ejemplo n.º 4
0
		void ComboBox::render() {
			renderBackground();
			renderArrow();
			renderOverlay();

			Renderer* g = ARK2D::getRenderer();
			if (m_selected != NULL) {
				float tx = 0;
				float ty = 0;
				if (m_state == Button::STATE_DOWN || m_open) {
					tx += 2;
					ty += 2;
				}
				g->drawString(m_selected->m_text, tx, ty);
			}

			if (m_open) {
				int y = 0 + m_originalHeight;
				for(unsigned int i = 0; i < m_items.size(); i++) {
					m_items.at(i)->setLocation(0, y);
					y += m_items.at(i)->getHeight();
				}
				renderChildren();
			}
		}
Ejemplo n.º 5
0
void View::render()
{
	clearSurface(screenSurface);
	clearSurface(overlaySurface);
	renderBorder();
	renderOverlay();
	renderMerged();
	SDL_Flip(screenSurface);
}
Ejemplo n.º 6
0
		void ComboBoxItem::render() {
			renderBackground();
			renderOverlay();

			Renderer* g = ARK2D::getRenderer();
			float tx = 0;
			float ty = 0;
			if (m_state == Button::STATE_DOWN) {
				tx += 2;
				ty += 2;
			} 
			g->drawString(m_text, tx, ty);
		}
Ejemplo n.º 7
0
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
		case WM_PAINT:
			renderOverlay();
			break;
		case WM_CREATE:
			DwmExtendFrameIntoClientArea(hWnd, &margins);
			break;
		case WM_DESTROY:

			PostQuitMessage(0);
			return 0;
	}

	return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
Ejemplo n.º 8
0
		void ComboBox::render() {
			renderBackground();
			renderArrow();
			renderOverlay();

			Renderer* g = ARK2D::getRenderer();
			if (m_selected != NULL) {
				g->drawString(m_selected->m_text, m_x, m_y);
			}

			if (m_open) {
				int y = m_y + m_originalHeight;
				for(unsigned int i = 0; i < m_items.size(); i++) {
					m_items.at(i)->setLocation(m_x, y);
					m_items.at(i)->render();
					y += m_items.at(i)->getHeight();
				}
			}
		}
Ejemplo n.º 9
0
void TextOverlay::process() {
    if (!inport_.isReady())
        outport_.activateTarget();
    else
        privatePort_.activateTarget();

    if (getInvalidationLevel() >= Processor::INVALID_PROGRAM)
        compile();

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    glClearDepth(1.0);

    glDisable(GL_DEPTH_TEST);

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

#ifndef VRN_MODULE_FONTRENDERING
    LWARNING("Empty output, enable module 'fontrendering'.");
#endif

    if(enabled_.get())
        renderOverlay();

    if (!inport_.isReady())
        outport_.deactivateTarget();
    else
        privatePort_.deactivateTarget();

    glEnable(GL_DEPTH_TEST);

    // skip if there's nothing to render above
    if (inport_.isReady()) {
        outport_.activateTarget();
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        TextureUnit colorUnit0, colorUnit1, depthUnit0, depthUnit1;
        privatePort_.bindTextures(colorUnit0.getEnum(), depthUnit0.getEnum());
        inport_.bindTextures(colorUnit1.getEnum(), depthUnit1.getEnum());

        // initialize shader
        program_->activate();
        setGlobalShaderParameters(program_);
        program_->setUniform("colorTex0_", colorUnit0.getUnitNumber());
        program_->setUniform("colorTex1_", colorUnit1.getUnitNumber());
        program_->setUniform("depthTex1_", depthUnit1.getUnitNumber());
        privatePort_.setTextureParameters(program_, "textureParameters0_");
        inport_.setTextureParameters(program_, "textureParameters1_");
        program_->setUniform("option_", blendMode_.getValue());

        ImageProcessor::renderQuad();

        outport_.deactivateTarget();

        TextureUnit::setZeroUnit();
        program_->deactivate();
    }
    LGL_ERROR;
}
Ejemplo n.º 10
0
INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
{

	WNDCLASSEX		cx;
	HWND			hWnd = NULL;

	cx.cbClsExtra = NULL;
	cx.cbSize = sizeof(WNDCLASSEX);
	cx.cbWndExtra = NULL;
	cx.hbrBackground = (HBRUSH)0;
	cx.hCursor = LoadCursor(NULL, IDC_ARROW);
	cx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	cx.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
	cx.hInstance = hInstance;
	cx.lpfnWndProc = WndProc;
	cx.lpszClassName = L"Cross";
	cx.lpszMenuName = NULL;
	cx.style = CS_HREDRAW | CS_VREDRAW;

	if (!RegisterClassEx(&cx))
		MessageBox(NULL, L"Couldn't register class", NULL, NULL), exit(0);

	hWnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TOOLWINDOW, L"Cross", L"Cross", WS_POPUP, 0, 0, screenX, screenY, NULL, NULL, hInstance, NULL);
	SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 255, ULW_COLORKEY | LWA_ALPHA);

	ShowWindow(hWnd, nShowCmd);

	if (!rMGR.Initilize(hWnd, screenX, screenY))
		MessageBox(NULL, L"Couldn't initialize device", NULL, NULL), exit(0);

	if (!d3.Initilize(&rMGR))
		MessageBox(NULL, L"Couldn't initialize D3Menu", NULL, NULL), exit(0);

	d3.createMenu( "menu1", D3DCOLOR_ARGB(255,152,222,42) );
	PMENUENTRY entry = d3.createMenu( "menu2", D3DCOLOR_ARGB(255,152,222,42) );

	INT v1 = 10;
	FLOAT v2 = 20;
	string v3 = "oh hai johnny!";

	d3.createItem( "item1", &v1, D3DCOLOR_ARGB(255,242,37,5), 10, VAR_TYPE::T_INT, nullptr, nullptr, false );
	d3.createItem( "item2", &v2, D3DCOLOR_ARGB(255,242,37,5), (SIZE_T)1.5, VAR_TYPE::T_FLOAT, nullptr, nullptr, false );
	d3.createItem( "item3", &v3, D3DCOLOR_ARGB(255,242,37,5), 10, VAR_TYPE::T_STRING, nullptr, nullptr, false );

	d3.createItem( entry,"item_menu1", &v3, D3DCOLOR_ARGB(255,152,222,42), 10, VAR_TYPE::T_STRING, nullptr, nullptr, false );
	d3.createItem( entry,"item_menu2", &v3, D3DCOLOR_ARGB(255,152,222,42), 10, VAR_TYPE::T_STRING, nullptr, nullptr, false );
	d3.createItem( entry,"item_menu3", &v3, D3DCOLOR_ARGB(255,152,222,42), 10, VAR_TYPE::T_STRING, nullptr, nullptr, false );

	d3.createToggle( "Toggle1", &isRunning, D3DCOLOR_ARGB(255,0,153,204), nullptr, false );

	MSG msg;
	while (isRunning)
	{
		d3.handleInput();
		renderOverlay();

		while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}

	rMGR.~rManager();

	return msg.wParam;
}