Re: Registering a class that takes a float*

Ryan Pavlik <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
You might be able to use it like that: here's a part of some code that I
wrote that lets you wrap functions that involve OpenSceneGraph types, where
I'm using another library (osgLua) to handle those on the Lua side
primarily. Between this and the documentation, it should be enough to help
you do a similar thing for GLfloat*

https://gist.github.com/5d6ece6101d3695e43c0

<https://gist.github.com/5d6ece6101d3695e43c0>Ryan

On Tue, Jan 4, 2011 at 10:13 PM, beo wulf <[email protected]> wrote:

> I want to bind all of OpenGL. I don't want to have to individually
> wrap any OpenGL function that takes a GLfloat* .
>
> What does default_converter do? Does it solve the problem I'm facing?
>
> On Tue, Jan 4, 2011 at 7:56 PM, Tony Kostanjsek <[email protected]>
> wrote:
> > hi,
> > Maybe it's easier for you if you write more specific get functions
> > (glGetVec2/3/4, glGetMatrix etc.) that return a struct instead of
> creating
> > bindings for functions with float arrays?
> > best,
> > Tony
> >
> >
> > ----- Ursprüngliche Mail ----
> > Von: beo wulf <[email protected]>
> > An: [email protected]
> > Gesendet: Mittwoch, den 5. Januar 2011, 3:43:40 Uhr
> > Betreff: [luabind] Registering a class that takes a float*
> >
> > I want to register this function.
> >
> > GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
> >
> > I also have a :
> >
> > GLfloat* get_raw(boost::shared_ptr<std::vector<GLfloat> > p) {
> >  return &( (*p)[0] );
> > }
> >
> >
> > I know that I can do:
> >
> > .def( "glGetFloatv", &glGetFloatv)
> > .def( "get_raw", &get_raw);
> >
> > However, I don't know what types I need to register so that Luabind
> > will understand the GLfloat* type
> >
> > I.e. make the following work:
> >
> > blah.lua:
> >
> > glGetFloatv(some_constant, some_vector:get_raw());
> >
> >
> > Thanks!
> >
> >
> ------------------------------------------------------------------------------
> > Learn how Oracle Real Application Clusters (RAC) One Node allows
> customers
> > to consolidate database storage, standardize their database environment,
> and,
> > should the need arise, upgrade to a full multi-node Oracle RAC database
> > without downtime or disruption
> > http://p.sf.net/sfu/oracle-sfdevnl
> > _______________________________________________
> > luabind-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/luabind-user
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Learn how Oracle Real Application Clusters (RAC) One Node allows
> customers
> > to consolidate database storage, standardize their database environment,
> and,
> > should the need arise, upgrade to a full multi-node Oracle RAC database
> > without downtime or disruption
> > http://p.sf.net/sfu/oracle-sfdevnl
> > _______________________________________________
> > luabind-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/luabind-user
> >
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>



-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

[email protected]
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.