Exemplo n.º 1
0
//---------------------------------------------------------------------------
bool CEditorRenderDevice::Create()
{
	if (b_is_Ready)	return false;
    Statistic			= xr_new<CEStats>();
	ELog.Msg(mtInformation,"Starting RENDER device...");


	HW.CreateDevice		(m_hRenderWnd, false);

	// after creation
	dwFrame				= 0;

	string_path 		sh;
    FS.update_path		(sh,_game_data_,"shaders.xr");

    IReader* F			= 0;
	if (FS.exist(sh))
		F				= FS.r_open(0,sh);
	Resources			= xr_new<CResourceManager>	();

    // if build options - load textures immediately
    if (strstr(Core.Params,"-build")||strstr(Core.Params,"-ebuild"))
        EDevice.Resources->DeferredLoad(FALSE);

    _Create				(F);
	FS.r_close			(F);

	ELog.Msg			(mtInformation, "D3D: initialized");

	return true;
}
Exemplo n.º 2
0
void CEditorRenderDevice::Reset(IReader* F, BOOL bKeepTextures)
{
	CTimer tm;
    tm.Start();
	_Destroy		(bKeepTextures);
	_Create			(F);
	Msg				("*** RESET [%d ms]",tm.GetElapsed_ms());
}
Exemplo n.º 3
0
	  void VertexBuffer::Create(
		  ID3D12Device* device,
		  int32_t sizeInBytes,
		  int32_t strideInBytes,
		  _In_opt_ const void* data)
	  {
		  m_Stride = strideInBytes;
		  _Create(device, sizeInBytes, data);
		  m_View.BufferLocation = m_Resource->GetGPUVirtualAddress();
		  m_View.SizeInBytes = sizeInBytes;
		  m_View.StrideInBytes = strideInBytes;
	  }
Exemplo n.º 4
0
bool Solver_Core::Create(double CVM_eps)
{
	bool flag = _Create(CVM_eps);
	if (flag) 
	{
		// use a small subset for initial MEB
		solver->Solve(coreIdx,coreNum,tempD);
		outAlpha = solver->getAlpha();
		ComputeRadius2();
	}
	return flag;
}
Exemplo n.º 5
0
bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
{
	//sLog.outDebug("Item::LoadFromDB guid %u, owner %u", guid, owner_guid);
	bool delete_result = false;
	if(!result)
	{
		result = CharacterDatabase.PQuery("SELECT data FROM item_instance WHERE guid = '%u'", guid);
		delete_result = true;
	}

	if(!result)
	{
		sLog.outError("ERROR: Item (GUID: %u owner: %u) not found in table `item_instance`, can't load.", guid, GUID_LOPART(owner_guid));
		return false;
	}

	Field *f = result->Fetch();

	_Create(guid, HIGHGUID_ITEM);

	if(!LoadValues(f[0].GetString()))
	{
		sLog.outError("ERROR: Item #%d have broken data in `data` field. Can't be loaded.", guid);
		if(delete_result) delete result;
		return false;
	}

	// Load item values
	//SetUInt32Value(OBJECT_FIELD_ENTRY, f[0].GetUInt32());

	//SetUInt32Value(ITEM_FIELD_STACK_COUNT, f[2].GetUInt32());

	// overwrite possible wrong/corrupted guid
	SetUInt64Value(OBJECT_FIELD_GUID,MAKE_GUID(guid,HIGHGUID_ITEM));

	if(delete_result) delete result;

	if(owner_guid != 0)
		SetOwnerGUID(owner_guid);

	return true;
}
Exemplo n.º 6
0
    bool DiWin32EGLWindow::Create(uint32& width, uint32& height, const DiString& title, bool fullscreen)
    {
        ::EGLContext eglContext = 0;
        if (!mEglConfig)
        {
            uint32 samples = 0;
            int minAttribs[] = 
            {
                EGL_LEVEL, 0,
                EGL_DEPTH_SIZE, 16,
                EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
                EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
                EGL_NATIVE_RENDERABLE, EGL_FALSE,
                EGL_DEPTH_SIZE, EGL_DONT_CARE,
                EGL_NONE
            };

            int maxAttribs[] = 
            {
                EGL_SAMPLES, samples,
                EGL_STENCIL_SIZE, INT_MAX,
                EGL_NONE
            };

            mEglConfig = mGLSupport->SelectGLConfig(minAttribs, maxAttribs);
        }

        bool ret = _Create(width, height, title, fullscreen);

        mContext = CreateEGLContext();
        mContext->BeginContext();
        ::EGLSurface oldDrawableDraw = eglGetCurrentSurface(EGL_DRAW);
        ::EGLSurface oldDrawableRead = eglGetCurrentSurface(EGL_READ);
        ::EGLContext oldContext = eglGetCurrentContext();

        int glConfigID;
        mGLSupport->GetGLConfigAttrib(mEglConfig, EGL_CONFIG_ID, &glConfigID);

        DI_INFO("EGLWindow::create used FBConfigID = %d", glConfigID);
        return ret;
    }
Exemplo n.º 7
0
STDMETHODIMP CSymbIHXDataFile::Open(UINT16 uOpenMode)
{
   return _Create(uOpenMode, FALSE);
}
Exemplo n.º 8
0
STDMETHODIMP CSymbIHXDataFile::Create(UINT16 uOpenMode)
{
   return _Create(uOpenMode, TRUE);
}
Exemplo n.º 9
0
CHbgDebugLoop::CHbgDebugLoop(DWORD pid, IStream* pIClbkStream)
:	m_dbggee(pid), m_pIClbkStream(pIClbkStream), m_bConnected(FALSE), m_hDebugLoopThread(INVALID_HANDLE_VALUE)
{
	_Create(pIClbkStream);
}
Exemplo n.º 10
0
CHbgDebugLoop::CHbgDebugLoop(LPCWSTR path, IStream* pIClbkStream)
:	m_dbggee(path), m_pIClbkStream(pIClbkStream), m_bConnected(FALSE), m_hDebugLoopThread(INVALID_HANDLE_VALUE)
{
	_Create(pIClbkStream);
}
Exemplo n.º 11
0
void
MainWindow::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case MSG_MOUNT_ALL:
			_MountAll();
			break;
		case MSG_MOUNT:
			_Mount(fCurrentDisk, fCurrentPartitionID);
			break;
		case MSG_UNMOUNT:
			_Unmount(fCurrentDisk, fCurrentPartitionID);
			break;

		case MSG_FORMAT:
			printf("MSG_FORMAT\n");
			break;

		case MSG_CREATE: {
			_Create(fCurrentDisk, fCurrentPartitionID);
			break;
		}

		case MSG_INITIALIZE: {
			BString diskSystemName;
			if (message->FindString("disk system", &diskSystemName) != B_OK)
				break;
			_Initialize(fCurrentDisk, fCurrentPartitionID, diskSystemName);
			break;
		}

		case MSG_DELETE:
			_Delete(fCurrentDisk, fCurrentPartitionID);
			break;

		case MSG_EJECT:
			// TODO: completely untested, especially interesting
			// if partition list behaves when partitions disappear
			if (fCurrentDisk) {
				// TODO: only if no partitions are mounted anymore?
				fCurrentDisk->Eject(true);
				_ScanDrives();
			}
			break;
		case MSG_SURFACE_TEST:
			printf("MSG_SURFACE_TEST\n");
			break;

		// TODO: this could probably be done better!
		case B_DEVICE_UPDATE:
			printf("B_DEVICE_UPDATE\n");
		case MSG_RESCAN:
			_ScanDrives();
			break;

		case MSG_PARTITION_ROW_SELECTED:
			// selection of partitions via list view
			_AdaptToSelectedPartition();
			break;
		case MSG_SELECTED_PARTITION_ID: {
			// selection of partitions via disk view
			partition_id id;
			if (message->FindInt32("partition_id", &id) == B_OK) {
				if (BRow* row = fListView->FindRow(id)) {
					fListView->DeselectAll();
					fListView->AddToSelection(row);
					_AdaptToSelectedPartition();
				}
			}
			break;
		}

		default:
			BWindow::MessageReceived(message);
			break;
	}
}