Jump to content

How do i get a pointer to the window and the graphics device (c++)


Charrua
 Share

Recommended Posts

Hi

 

i'm trying to connect Leadwerks to a gui, which development has stopped, but that i used and use at present with other engines (albalynx).

 

One of the firsts steps consist in passing pointers of the window's window and the graphics device (openGL i guess), albalynx is supposed to support DirecX9,10,11 and OpenGL 4

 

I found some functions and properties like:

 

Context* context->getCurrent();

Window* window->getCurrent();

window->whnd;

 

i readed about Window:GetHandle()

 

http://www.leadwerks.com/werkspace/topic/10381-requested-features-and-improvements/page__st__40#entry76787

 

but seems to not exists.

 

any help is appreciated!

 

thank's in advance

 

jio

Paren el mundo!, me quiero bajar.

Link to comment
Share on other sites

Hey, thank's for you fast response:)

 

the first step seemed to be the easiest one and... i'm stuck on it!

 

Transfer functions to AlbaLynx [C++]

If you are using C++, then the easiest way is to create a derived class based on cALInput:

class cInput : public cALInput {

public:

// Implementation of abstract methods

virtual int MouseX() { … }

virtual void FlushMouse() { … }

};

In the constructor of the base class (cALInput) a pointer to an instance of this class is written in a static variable, so that the GUI can refer to it.

Before initializing the GUI, simply create an instance of this class:

// Connect AlbaLynx to input system

cInput input;

 

but when i call the init function the message isn't about window o graphics pointers ... is about that the pointer to input is null.

 

so... i'll keep trying :)

Paren el mundo!, me quiero bajar.

Link to comment
Share on other sites

ok solved the init errors.. (most my fault)!

 

now, i think i get lost forever, when i try to update the gui, then:

 

Unhandled exception at 0x0F2B5C8D (AlbaLynx.dll) in jio.debug.exe: 0xC0000005: Access violation reading location 0x00000000.

 

 

i tested version 1060 and 1110, 1060 do not pass the initiate function

version 1110 pass the init (initiate is deprecated in this new version) so some checks like valid window and graphics devices are passed.

 

i can call many of the functions to create and set parameters, just update seems to fail

Paren el mundo!, me quiero bajar.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...