Esempio n. 1
0
bool ListBox::ArrangeChildren(const Rect2F& limitRect/*=Rect2F::Zero*/, NodeLayoutArrangeFlags arrangeFlags/*=NodeLayoutArrangeFlags::None*/)
{
	RETURN_TRUE_IF_NULL(mBinding);
	BaseListDataBinding* listDataBinding = (BaseListDataBinding*)mBinding;
	size_t itemCount = listDataBinding->Count();

	if (mItems.IsEmpty() && itemCount != 0)
	{
		OnTotalChanged();
	}
	else
	{

		Point2F totalMovment = mScrollModel->Offset();
		SetupItems();
		mScrollModel->ScrollBy(totalMovment);

		//check items
		FOR_EACH_SIZE(i, itemCount)
		{
			ListBoxItem& item = mItems[i];
			BREAK_IF_FALSE(TryLoadOrRecycleItem(item));
		}

	}
Esempio n. 2
0
bool WinEGLView::Uninitialize()
{
	RETURN_TRUE_IF_NULL(mEGLDisplay);

	/*
	Step 9 - Terminate OpenGL ES and destroy the window (if present).
	eglTerminate takes care of destroying any context or surface created
	with this display, so we don't need to call eglDestroySurface or
	eglDestroyContext here.
	*/
	if (mEGLDisplay != nullptr)
	{
		eglMakeCurrent(mEGLDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
		eglTerminate(mEGLDisplay);
		mEGLDisplay = EGL_NO_DISPLAY;
	}

	if (mIsNeedPixmap)
	{
		SelectObject(mPixmapDisplay, mBitmapPixmapOld);
		DeleteDC(mPixmapDisplay);
		DeleteObject(mBitmapPixmap);
	}

	/*
	Step 10 - Destroy the eglWindow.
	Again, this is platform specific and delegated to a separate function.
	*/
	if (mEGLNativeDisplay != nullptr)
	{
		ReleaseDC(mEGLNativeWindow, mEGLNativeDisplay);
		mEGLNativeWindow = nullptr;
		mEGLNativeDisplay = EGL_DEFAULT_DISPLAY;
	}

	//mEGLNativeWindow will be destroyed outside


	mEGLConfig = 0;
	mEGLSurface = EGL_NO_SURFACE;
	mEGLContext = EGL_NO_CONTEXT;

	return true;
}
Esempio n. 3
0
bool WinWindow::Uninitialize()
{
	RETURN_TRUE_IF_NULL(mWindowHandle);
	if (DestroyWindow(mWindowHandle) != 0)
	{
		//DWORD error= GetLastError();
		mWindowHandle = nullptr;
	}

	mWindowHandle = nullptr;

	HINSTANCE instance = GetModuleHandle(nullptr);
	if (!UnregisterClass(L"MedusaGameWindow", instance))
	{
		/*DWORD err= GetLastError();*/
		//log error
		MEDUSA_ASSERT_FAILED("");
	}
	return true;
}