您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetContext函数代码示例

51自学网 2021-06-01 21:05:38
  C++
这篇教程C++ GetContext函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetContext函数的典型用法代码示例。如果您正苦于以下问题:C++ GetContext函数的具体用法?C++ GetContext怎么用?C++ GetContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetContext函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AddHWBP

/// <summary>/// Add hardware breakpoint to thread/// </summary>/// <param name="addr">Breakpoint address</param>/// <param name="type">Breakpoint type(read/write/execute)</param>/// <param name="length">Number of bytes to include into breakpoint</param>/// <returns>Index of used breakpoint; -1 if failed</returns>int Thread::AddHWBP( ptr_t addr, HWBPType type, HWBPLength length ){    _CONTEXT64 context;    // CONTEXT_DEBUG_REGISTERS can be operated without thread suspension    if (!GetContext( context, CONTEXT64_DEBUG_REGISTERS, true ))        return -1;    auto getFree = []( ptr_t regval )    {        if (!(regval & 1))            return 0;        else if (!(regval & 4))            return 1;        else if (!(regval & 16))            return 2;        else if (!(regval & 64))            return 3;        return -1;    };    // Get free DR    int freeIdx = getFree( context.Dr7 );    // If all 4 registers are occupied - error    if (freeIdx < 0)        return -1;    // Enable corresponding HWBP and local BP flag    context.Dr7 |= (1 << (2 * freeIdx)) | ((int)type << (16 + 4 * freeIdx)) | ((int)length << (18 + 4 * freeIdx)) | 0x100;    *(&context.Dr0 + freeIdx) = addr;    // Write values to registers    if (!SetContext( context, true ))        return -1;    return freeIdx;}
开发者ID:Jeswang,项目名称:mono-assembly-injector,代码行数:47,


示例2: PresContext

already_AddRefed<nsStyleContext>nsStyleSet::ResolveStyleForNonElement(nsStyleContext* aParentContext){  nsStyleContext* result = nsnull;  nsPresContext *presContext = PresContext();  if (presContext) {    if (mRuleProcessors[eAgentSheet]        ||        mRuleProcessors[ePresHintSheet]     ||        mRuleProcessors[eUserSheet]         ||        mRuleProcessors[eHTMLPresHintSheet] ||        mRuleProcessors[eDocSheet]          ||        mRuleProcessors[eStyleAttrSheet]    ||        mRuleProcessors[eOverrideSheet]) {      result = GetContext(presContext, aParentContext,                          nsCSSAnonBoxes::mozNonElement).get();      NS_ASSERTION(mRuleWalker->AtRoot(), "rule walker must be at root");    }  }  return result;}
开发者ID:ahadzi,项目名称:celtx,代码行数:22,


示例3: GetContext

void CRenderingContext::UseProgram(class CShader* pShader){	CRenderContext& oContext = GetContext();	oContext.m_pShader = m_pShader = pShader;	if (!m_pShader)	{		oContext.m_szProgram[0] = '/0';		m_iProgram = 0;		glUseProgram(0);		return;	}	tstrncpy(oContext.m_szProgram, PROGRAM_LEN, pShader->m_sName.c_str(), PROGRAM_LEN);	m_iProgram = m_pShader->m_iProgram;	glUseProgram((GLuint)m_pShader->m_iProgram);	oContext.m_bProjectionUpdated = false;	oContext.m_bViewUpdated = false;}
开发者ID:BSVino,项目名称:CodenameInfinite,代码行数:22,


示例4: mbstowcs

// --------------------------------------------------------------void	GFontWin32GDIPlus::GetExtent( unsigned char c, float * outWidth, 					          float * outHeight, VGDevice * context ) const{	WCHAR wstr [] = L"0";	mbstowcs(wstr, (const char*)&c, 1);	Graphics* gdiContext = (Graphics*) GetContext( context );/*	-- known Gdi+ issue: 	We must use the following way to determine correct font extent 	because typical Graphics::MeasureString() method doesn't work	properly (return values are incorrect due to antialiasing)*/	Font* dgiFont = GetNativeFont();	// Layout rectangles used for drawing strings	RectF   layoutRect_A(0.0f, 0.0f, 1300.0f, 1300.0f);	// 1 range of character positions within the string	CharacterRange charRange(0, 1);	// String format used to apply to string when drawing	StringFormat strFormat;	// Set three ranges of character positions.	strFormat.SetMeasurableCharacterRanges(1, &charRange);	Region *pCharRangeRegions = new Region();	// Get the regions that correspond to the ranges within the string when	// layout rectangle A is used. 	gdiContext->MeasureCharacterRanges( wstr, 1, dgiFont, layoutRect_A, &strFormat, 1, pCharRangeRegions);	RectF boundRect;	pCharRangeRegions->GetBounds( &boundRect, gdiContext);	*outHeight = boundRect.Height;	*outWidth = boundRect.Width;	// in some cases (when some symbols must be forced into char map), extent needs to be fixed  	if (c == 139) *outWidth = 6.0;}
开发者ID:anttirt,项目名称:guidolib,代码行数:40,


示例5: GetActiveOffset

void Image::Draw(){	const Point &offset = GetActiveOffset();	const Point &area = GetActiveArea();	const float x = offset.x;	const float y = offset.y;	const float sx = area.x;	const float sy = area.y;	const vector2f texSize = m_texture->GetDescriptor().texSize;	Graphics::VertexArray va(Graphics::ATTRIB_POSITION | Graphics::ATTRIB_UV0);	va.Add(vector3f(x,    y,    0.0f), vector2f(0.0f,      0.0f));	va.Add(vector3f(x,    y+sy, 0.0f), vector2f(0.0f,      texSize.y));	va.Add(vector3f(x+sx, y,    0.0f), vector2f(texSize.x, 0.0f));	va.Add(vector3f(x+sx, y+sy, 0.0f), vector2f(texSize.x, texSize.y));	Graphics::Renderer *r = GetContext()->GetRenderer();	r->SetBlendMode(Graphics::BLEND_ALPHA);	r->DrawTriangles(&va, m_material.Get(), Graphics::TRIANGLE_STRIP);}
开发者ID:GizmoR13,项目名称:pioneer,代码行数:22,


示例6: GetClientSize

void tui::LayoutCanvas::OnresizeGL(wxSizeEvent& event) {    // this is also necessary to update the context on some platforms    wxGLCanvas::OnSize(event);    // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)    int w, h;    GetClientSize(&w, &h);   #ifndef __WXMOTIF__      if (GetContext())   #endif    {      SetCurrent();      glViewport( 0, 0, (GLint)w, (GLint)h );    }    lp_BL = TP(0,0)  * _LayCTM;    lp_TR = TP(w, h) * _LayCTM;//   glMatrixMode( GL_PROJECTION );//   glLoadIdentity();//   glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );   glMatrixMode( GL_MODELVIEW );   glClear(GL_ACCUM_BUFFER_BIT);   invalid_window = true;}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:22,


示例7: eglDestroyContext

// Destroy the specified rendering context.EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {  EGL_API_ENTRY("%p, %p", dpy, ctx);  EglDisplayImpl* display = EglDisplayImpl::GetDisplay(dpy);  if (display == NULL || display->IsInitialized() == false) {    SetError(EGL_BAD_DISPLAY);    return EGL_FALSE;  }  ContextPtr context = display->GetContexts().Get(ctx);  if (context == NULL) {    return EGL_BAD_CONTEXT;  }  if (GetContext() == context) {    display->MakeCurrent(EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE);  }  context->Release();  display->GetContexts().Unregister(ctx);  return EGL_TRUE;}
开发者ID:epowers,项目名称:arc,代码行数:23,


示例8: GetActiveOffset

void Gradient::Draw(){	const Point &offset = GetActiveOffset();	const Point &area = GetActiveArea();	const float x = offset.x;	const float y = offset.y;	const float sx = area.x;	const float sy = area.y;	Graphics::VertexArray va(Graphics::ATTRIB_POSITION | Graphics::ATTRIB_DIFFUSE);	va.Add(vector3f(x,    y,    0.0f), m_beginColor);	va.Add(vector3f(x,    y+sy, 0.0f), m_direction == HORIZONTAL ? m_beginColor : m_endColor);	va.Add(vector3f(x+sx, y,    0.0f), m_direction == HORIZONTAL ? m_endColor : m_beginColor);	va.Add(vector3f(x+sx, y+sy, 0.0f), m_endColor);	Graphics::Renderer *r = GetContext()->GetRenderer();	r->SetBlendMode(Graphics::BLEND_ALPHA);	r->DrawTriangles(&va, m_material.Get(), Graphics::TRIANGLE_STRIP);	Container::Draw();}
开发者ID:HeadHunterEG,项目名称:pioneer,代码行数:22,


示例9:

    Sink& BufferSink::MapEntry(Term& key, Term& value)    {        Term& t = *(terms.back());        Term& newmap = t.MapPutValue(GetContext(), key, value);        if (&newmap != &t)        {        	terms.pop_back();        	if (terms.empty())        		term = &newmap;        	else        	{        		subIndex.pop_back();        		int subindex = subIndex.back();        		Term& parent = *(terms.back());        		parent.SetSub(subindex - 1, newmap);        		subIndex.push_back(0);        	}        	terms.push_back(&newmap);        }        return *this;    }
开发者ID:tosca-lang,项目名称:tosca,代码行数:22,


示例10: glGetIntegerv

voidDisplayWindow::SetupView(int picking, int x, int y){	GLint viewport[4];	glGetIntegerv(GL_VIEWPORT, viewport);	int w,h;    GetClientSize(&w, &h);	if (!GetContext()) return;	SetCurrent();	float aspect = (float)w/h;	glMatrixMode(GL_PROJECTION);	glLoadIdentity();	if (picking) gluPickMatrix(x,viewport[3] - y,5.0,5.0,viewport);	glFrustum(-0.5, 0.5, -0.5/aspect, 0.5/aspect, 0.5, 10.0 );	glMatrixMode(GL_MODELVIEW);	glLoadIdentity();	glTranslatef( 0.0, 0.0, zoom);	glRotatef(yrot,0.0,1.0,0.0);	glRotatef(xrot,1.0,0.0,0.0);}
开发者ID:Seashell2011,项目名称:Wickbert,代码行数:22,


示例11: Sample2D

void Urho2DPlatformer::Start(){    // Execute base class startup    Sample::Start();    sample2D_ = new Sample2D(context_);    // Set filename for load/save functions    sample2D_->demoFilename_ = "Platformer2D";    // Create the scene content    CreateScene();    // Create the UI content    sample2D_->CreateUIContent("PLATFORMER 2D DEMO", character2D_->remainingLifes_, character2D_->remainingCoins_);    auto* ui = GetContext()->m_UISystem.get();    Button* playButton = static_cast<Button*>(ui->GetRoot()->GetChild("PlayButton", true));    playButton->released.Connect(this,&Urho2DPlatformer::HandlePlayButton);    // Hook up to the frame update events    SubscribeToEvents();}
开发者ID:nemerle,项目名称:lutefisk3d,代码行数:22,


示例12: Quartz_Polygon

static void 	Quartz_Polygon(int n, double *x, double *y, 			       R_GE_gcontext *gc,			       NewDevDesc *dd){   int	i;   QuartzDesc *xd = (QuartzDesc*)dd->deviceSpecific;   CGPoint *lines;   CGContextSaveGState( GetContext(xd) );   CGContextBeginPath( GetContext(xd) );/*  Quartz_SetLineProperties(gc, dd); */    lines = (CGPoint *)malloc(sizeof(CGPoint)*(n+1));    if(lines == NULL)     return;    for (i = 0; i < n; i++) {	  lines[i].x = (float)x[i];	  lines[i].y = (float)y[i];    }    lines[n].x = (float)x[0];    lines[n].y = (float)y[0];    CGContextAddLines( GetContext(xd), &lines[0], n+1 );     Quartz_SetLineProperties(gc, dd);	Quartz_SetFill( gc->fill, gc->gamma, dd);    CGContextFillPath( GetContext(xd) );    CGContextAddLines( GetContext(xd), &lines[0], n+1 );    Quartz_SetStroke( gc->col, gc->gamma,  dd);    CGContextStrokePath( GetContext(xd) );    CGContextRestoreGState( GetContext(xd) );}
开发者ID:Vladimir84,项目名称:rcc,代码行数:41,


示例13: GetContext

void Slider::HandleMouseMove(const MouseMotionEvent &event){	const Skin &skin = GetContext()->GetSkin();	if (m_buttonDown && IsMouseActive()) {		float travel;		if (m_orient == SLIDER_HORIZONTAL) {			const Skin::EdgedRectElement &gutterRect = skin.SliderHorizontalGutter();			const Skin::RectElement &buttonRect = skin.SliderHorizontalButtonNormal();			const int effectiveLength = GetActiveArea().x - gutterRect.edgeWidth*2 - buttonRect.size.x;			const int pos = Clamp(event.pos.x - int(gutterRect.edgeWidth) - buttonRect.size.x/2 - GetActiveOffset().x, 0, effectiveLength);			travel = float(pos) / effectiveLength;		}		else {			const Skin::EdgedRectElement &gutterRect = skin.SliderVerticalGutter();			const Skin::RectElement &buttonRect = skin.SliderVerticalButtonNormal();			const int effectiveLength = GetActiveArea().y - gutterRect.edgeWidth*2 - buttonRect.size.y;			const int pos = Clamp(event.pos.y - int(gutterRect.edgeWidth) - buttonRect.size.y/2 - GetActiveOffset().y, 0, effectiveLength);			travel = float(pos) / effectiveLength;		}		SetValue(travel);	}	else {		m_lastMousePosition = event.pos;		m_mouseOverButton = PointInsideButton(event.pos);	}	Widget::HandleMouseMove(event);}
开发者ID:HeadHunterEG,项目名称:pioneer,代码行数:38,


示例14: WXUNUSED

void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ){    // must always be here    wxPaintDC dc(this);#ifndef __WXMOTIF__    if (!GetContext()) return;#endif    SetCurrent();    // Initialize OpenGL    if (!m_gldata.initialized)    {        InitGL();        ResetProjectionMode();        m_gldata.initialized = true;    }    // Clear    glClearColor( 0.3f, 0.4f, 0.6f, 1.0f );    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );    // Transformations    glLoadIdentity();    glTranslatef( 0.0f, 0.0f, -20.0f );    GLfloat m[4][4];    build_rotmatrix( m, m_gldata.quat );    glMultMatrixf( &m[0][0] );    m_renderer.Render();    // Flush    glFlush();    // Swap    SwapBuffers();}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:38,


示例15: Encrypt

/*--------------------------------------------------------------------------------*/void ABlowfish::Encrypt(const uint8_t *src, uint8_t *dst, uint32_t& iv1, uint32_t& iv2){	BLOWFISH_CTX *ctx = (BLOWFISH_CTX *)GetContext();	uint32_t l, r;	// copy bytes into 2 32-bit variables	memcpy(&l, src, sizeof(l)); src += sizeof(l);	memcpy(&r, src, sizeof(r));	// for little endian machines, swap bytes to make all data big-endian	if (!MachineIsBigEndian()) {		l = SwapBytes(l);		r = SwapBytes(r);	}	// XOR in initialisation vectors (for CBC mode)	l ^= iv1;	r ^= iv2;	// encrypt data	Blowfish_Encrypt(ctx, &l, &r);	// return new initialisation vectors (for CBC mode)	iv1 = l;	iv2 = r;	// for little endian machines, swap bytes back to make all data little-endian	if (!MachineIsBigEndian()) {		l = SwapBytes(l);		r = SwapBytes(r);	}	// copy bytes to destination	memcpy(dst, &l, sizeof(l)); dst += sizeof(l);	memcpy(dst, &r, sizeof(r));	l = r = 0;	// clear local variables to prevent security leaks}
开发者ID:richardxday,项目名称:rdlib,代码行数:39,


示例16: eglCreateSyncKHR

// Create a reusable EGL sync object.EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type,                            const EGLint* attrib_list) {  EGL_API_ENTRY("%p, 0x%x, %p", dpy, type, attrib_list);  EglDisplayImpl* display = EglDisplayImpl::GetDisplay(dpy);  if (display == NULL) {    SetError(EGL_BAD_DISPLAY);    return EGL_NO_SYNC_KHR;  }  if (type != EGL_SYNC_FENCE_KHR ||      (attrib_list != NULL && attrib_list[0] != EGL_NONE)) {    SetError(EGL_BAD_ATTRIBUTE);    return EGL_NO_SYNC_KHR;  }  ContextPtr context = GetContext();  if (context == NULL) {    SetError(EGL_BAD_MATCH);    return EGL_NO_SYNC_KHR;  }  glFinish();  return kFenceSyncHandle;}
开发者ID:epowers,项目名称:arc,代码行数:24,


示例17: LoadScriptL

void LoadScriptL(CLocaLogic* cl, const TDesC& aScriptName){	TFileName fn=_L("c://system//data//context//scripts//");	fn.Append(aScriptName);	RAFile f;	f.OpenLA(GetContext()->Fs(), fn, EFileRead|EFileShareAny);	TBuf8<256> buf8;	TBuf<256> buf;	_LIT(KScript, "script");	auto_ptr<CBBString> ss(CBBString::NewL(KScript));	while (f.Read(buf8)==KErrNone && buf8.Length()>0) {		buf.Copy(buf8);		ss->Append(buf);	}	if (aScriptName[0]=='_') {		TPtrC script=aScriptName.Left(aScriptName.Length()-3);		cl->NewScriptL(script, ss.get());	} else {		TPtrC tp=aScriptName.Mid(4);		TPtrC script=tp.Left(tp.Length()-3);		cl->NewScriptL(script, ss.get());	}}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:23,


示例18: SwrSync

void SwrSync(HANDLE hContext, PFN_CALLBACK_FUNC pfnFunc, uint64_t userData, uint64_t userData2){    RDTSC_START(APISync);    SWR_CONTEXT *pContext = GetContext(hContext);    DRAW_CONTEXT* pDC = GetDrawContext(pContext);    pDC->inUse = true;    pDC->FeWork.type = SYNC;    pDC->FeWork.pfnWork = ProcessSync;    pDC->FeWork.desc.sync.pfnCallbackFunc = pfnFunc;    pDC->FeWork.desc.sync.userData = userData;    pDC->FeWork.desc.sync.userData2 = userData2;    // cannot execute until all previous draws have completed    pDC->dependency = pDC->drawId - 1;    //enqueue    QueueDraw(pContext);    RDTSC_STOP(APISync, 1, 0);}
开发者ID:utkarshayachit,项目名称:openswr-mesa,代码行数:23,


示例19: LogStartAny

HANDLE LogStartAny(TInt aOp) {	CApp_context *c=(CApp_context *)GetContext();	if (!c) return INVALID_HANDLE_VALUE;	HANDLE logfile=c->iHookData;	if (!logfile) {		TBuf<100> filen=_L("c://");		filen.Append(c->Name());		filen.Append(_L("-alloctrace.dat"));		logfile=CreateFile( filen.PtrZ(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 );		c->iHookData=logfile;	}	if (logfile==INVALID_HANDLE_VALUE) return logfile;	DWORD written;	BOOL ret;	DWORD err;	ret=WriteFile(logfile, &aOp, sizeof(aOp), &written, 0);	if (!ret) err=GetLastError();	const TDesC8& stack=c->FullCallStackBuffer();	TInt len=stack.Length();	ret=WriteFile(logfile, &len, sizeof(len), &written, 0);	ret=WriteFile(logfile, stack.Ptr(), stack.Length(), &written, 0);	return logfile;}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:23,


示例20: Attach

  size_t  TerminalDisplay::WriteWrapped(Range::EPromptUpdate PromptUpdate, bool hidden,                                size_t Offset, size_t Requested /* = -1*/) {    Attach();    const Text& Prompt = GetContext()->GetPrompt();    size_t PromptLen = GetContext()->GetPrompt().length();    const Text& EditPrompt = GetContext()->GetEditor()->GetEditorPrompt();    size_t EditorPromptLen = EditPrompt.length();    if (!IsTTY()) {       PromptLen = 0;       EditorPromptLen = 0;       PromptUpdate = Range::kNoPromptUpdate;    }    if (PromptUpdate & Range::kUpdatePrompt) {      // Writing from front means we write the prompt, too      Move(Pos());      WriteWrappedElement(Prompt, 0, 0, PromptLen);    }    if (PromptUpdate != Range::kNoPromptUpdate) {      // Any prompt update means we'll have to re-write the editor prompt      Move(IndexToPos(PromptLen));      if (EditorPromptLen) {        WriteWrappedElement(EditPrompt, 0, PromptLen, EditorPromptLen);      }      // Any prompt update means we'll have to re-write the text      Offset = 0;      Requested = (size_t) -1;    }    Move(IndexToPos(PromptLen + EditorPromptLen + Offset));    size_t avail = 0;    if (hidden) {      Text hide(std::string(GetContext()->GetLine().length(), '*'), 0);      avail = WriteWrappedElement(hide, Offset,                                  PromptLen + EditorPromptLen, Requested);    } else {      avail = WriteWrappedElement(GetContext()->GetLine(), Offset,                                       PromptLen + EditorPromptLen, Requested);    }    fWriteLen = PromptLen + EditorPromptLen + GetContext()->GetLine().length();    return avail;  }
开发者ID:0x0all,项目名称:ROOT,代码行数:45,


示例21: GetInnerWidget

void Button::Layout(){	Widget *innerWidget = GetInnerWidget();	if (!innerWidget) {		SetActiveArea(Point(GetContext()->GetSkin().ButtonMinInnerSize()) + Point(GetContext()->GetSkin().ButtonNormal().borderWidth*2));		return;	}	const Point innerSize = GetSize() - Point(GetContext()->GetSkin().ButtonNormal().borderWidth*2);	SetWidgetDimensions(innerWidget, Point(GetContext()->GetSkin().ButtonNormal().borderWidth), CalcSize(innerWidget, innerSize));	innerWidget->Layout();	Point innerActiveArea(innerWidget->GetActiveArea());	growToMinimum(innerActiveArea, GetContext()->GetSkin().ButtonMinInnerSize());	SetActiveArea(innerActiveArea + Point(GetContext()->GetSkin().ButtonNormal().borderWidth*2));}
开发者ID:HeadHunterEG,项目名称:pioneer,代码行数:18,


示例22: GetContext

void CheckBox::Draw(){	if (m_checked) {		if (IsDisabled())			GetContext()->GetSkin().DrawCheckBoxCheckedDisabled(GetActiveOffset(), GetActiveArea());		else if (IsMouseOver())			GetContext()->GetSkin().DrawCheckBoxCheckedHover(GetActiveOffset(), GetActiveArea());		else			GetContext()->GetSkin().DrawCheckBoxCheckedNormal(GetActiveOffset(), GetActiveArea());	} else {		if (IsDisabled())			GetContext()->GetSkin().DrawCheckBoxDisabled(GetActiveOffset(), GetActiveArea());		else if (IsMouseOver())			GetContext()->GetSkin().DrawCheckBoxHover(GetActiveOffset(), GetActiveArea());		else			GetContext()->GetSkin().DrawCheckBoxNormal(GetActiveOffset(), GetActiveArea());	}}
开发者ID:Ikesters,项目名称:pioneer,代码行数:18,


示例23: CreateContext

// Creates a new element context.Context* CreateContext(const String& name, const Vector2i& dimensions, RenderInterface* custom_render_interface){	if (!initialised)		return NULL;	if (custom_render_interface == NULL &&		render_interface == NULL)		Log::Message(Log::LT_WARNING, "Failed to create context '%s', no render interface specified and no default render interface exists.", name.CString());	if (GetContext(name) != NULL)	{		Log::Message(Log::LT_WARNING, "Failed to create context '%s', context already exists.", name.CString());		return NULL;	}	Context* new_context = Factory::Instance()->InstanceContext(name);	if (new_context == NULL)	{		Log::Message(Log::LT_WARNING, "Failed to instance context '%s', instancer returned NULL.", name.CString());		return NULL;	}	// Set the render interface on the context, and add a reference onto it.	if (custom_render_interface)		new_context->render_interface = custom_render_interface;	else		new_context->render_interface = render_interface;	new_context->render_interface->AddReference();	new_context->SetDimensions(dimensions);	contexts[name] = new_context;	PluginRegistry::Instance()->NotifyContextCreate(new_context);	return new_context;}
开发者ID:UIKit0,项目名称:librocket-1,代码行数:37,


示例24: SwrSetLinkage

void SwrSetLinkage(    HANDLE hContext,    uint32_t mask,    const uint8_t* pMap){    API_STATE* pState = GetDrawState(GetContext(hContext));    static const uint8_t IDENTITY_MAP[] =    {         0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,        16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,    };    static_assert(sizeof(IDENTITY_MAP) == sizeof(pState->linkageMap),        "Update for new value of MAX_ATTRIBUTES");    pState->linkageMask = mask;    pState->linkageCount = _mm_popcnt_u32(mask);    if (!pMap)    {        pMap = IDENTITY_MAP;    }    memcpy(pState->linkageMap, pMap, pState->linkageCount);}
开发者ID:utkarshayachit,项目名称:openswr-mesa,代码行数:24,


示例25: THROW_ARGOSEXCEPTION

 SAnchor& CEmbodiedEntity::AddAnchor(const std::string& str_id,                                     const CVector3& c_offset_position,                                     const CQuaternion& c_offset_orientation) {    /* Make sure the anchor id is unique */    if(m_mapAnchors.count(str_id) > 0 ) {       THROW_ARGOSEXCEPTION("Embodied entity /"" << GetContext() + GetId() << "/" already has an anchor with id " << str_id);    }    /* Calculate anchor position */    CVector3 cPos = c_offset_position;    cPos.Rotate(m_psOriginAnchor->Orientation);    cPos += m_psOriginAnchor->Position;    /* Calculate anchor orientation */    CQuaternion cOrient = m_psOriginAnchor->Orientation * c_offset_orientation;    /* Create anchor */    SAnchor* psAnchor = new SAnchor(str_id,                                    m_mapAnchors.size(),                                    c_offset_position,                                    c_offset_orientation,                                    cPos,                                    cOrient);    /* Add anchor to map */    m_mapAnchors[str_id] = psAnchor;    return *psAnchor; }
开发者ID:hoelzl,项目名称:argos3,代码行数:24,


示例26: ASSERT

BOOL CSSLContext::Initialize(EnSSLSessionMode enSessionMode, int iVerifyMode, LPCTSTR lpszPemCertFile, LPCTSTR lpszPemKeyFile, LPCTSTR lpszKeyPasswod, LPCTSTR lpszCAPemCertFileOrPath, HP_Fn_SNI_ServerNameCallback fnServerNameCallback){	ASSERT(!IsValid());	if(IsValid())	{		::SetLastError(ERROR_INVALID_STATE);		return FALSE;	}	m_enSessionMode	= enSessionMode;	if(AddContext(iVerifyMode, lpszPemCertFile, lpszPemKeyFile, lpszKeyPasswod, lpszCAPemCertFileOrPath) == 0)		m_sslCtx = GetContext(0);	else	{		Cleanup();		return FALSE;	}	SetServerNameCallback(fnServerNameCallback);	return TRUE;}
开发者ID:MarkYangUp,项目名称:HP-Socket,代码行数:24,


示例27: GetClientSize

void wxCoreGLCanvas::ResizeGL(void){    // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)    wxInt32 w, h;    GetClientSize(&w, &h);    if (GetContext())    {        SetCurrent();        glViewport(0, 0, (GLint) w, (GLint) h);		//select the projection matrix and reset it		glMatrixMode(GL_PROJECTION);		glLoadIdentity();		//calculate the aspect ratio		GLfloat dAspect;		dAspect = (GLfloat) w / (GLfloat) h;		gluPerspective(45.0f, dAspect, 0.1, 250.);		//reset the modelview matrix		glMatrixMode(GL_MODELVIEW);    }}
开发者ID:Dangr8,项目名称:Cities3D,代码行数:24,



注:本文中的GetContext函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetContextSuspended函数代码示例
C++ GetContainer函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。