示例#1
0
int CResourceViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// Create view:
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndResourceView.Create(dwViewStyle, rectDummy, this, 3))
	{
		TRACE0("Failed to create workspace view\n");
		return -1;      // fail to create
	}

	// Load view images:
	m_ResourceViewImages.Create(IDB_RESOURCE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndResourceView.SetImageList(&m_ResourceViewImages, TVSIL_NORMAL);

	// Fill view context(dummy code, don't seek here something magic :-)):
	InitResourceView();

	OnChangeVisualStyle();
	return 0;
}
示例#2
0
gs_texture_2d::gs_texture_2d(device_t device, uint32_t width, uint32_t height,
		gs_color_format colorFormat, uint32_t levels, const void **data,
		uint32_t flags, gs_texture_type type, bool gdiCompatible,
		bool shared)
	: gs_texture      (device, type, levels, colorFormat),
	  width           (width),
	  height          (height),
	  dxgiFormat      (ConvertGSTextureFormat(format)),
	  isGDICompatible (gdiCompatible),
	  isShared        (shared),
	  isDynamic       ((flags & GS_DYNAMIC) != 0),
	  isRenderTarget  ((flags & GS_RENDERTARGET) != 0),
	  genMipmaps      ((flags & GS_BUILDMIPMAPS) != 0)
{
	InitTexture(data);
	InitResourceView();

	if (isRenderTarget)
		InitRenderTargets();
}