« first day    last day (49 days later) » 

08:48
1 message moved from iOS Developer Family
Sorry moved msg in wrong room :((
heartly apologise
09:13
1 message moved to Trash can
 
5 hours later…
14:23
@BartekBanachewicz pastebin.com/LTkpzNtf
hem hem
Y not Coliru or Gist? :P
pastebin is inferior
@kbok does it already work? :#
I'll paste stuff in coliru once we have lua
What I have pasted works, indeed, with unsigned, signed, double, string, and nil
The most interesting being IMO:
lua.eval("function my_add(i, j, k) return i + j + k end");
std::cout << lua.call("my_add", 3, 6, 2) << std::endl;
@kbok variadic templates?
yeah
Have you tested it in VS2012 already, perchance?
14:28
Not yet, but I'm confident since this is not much different from what make_shared does
variant call_r(std::string const &name, int nargs) {
  lua_call(state_, nargs, 1);
  return pop();
}

template<typename T, typename... Args>
variant call_r(std::string const &name, int nargs, T t, Args... args) {
  boost::apply_visitor(push_variant(state_), t);
  return call_r(name, nargs + 1, args);
}

template<typename... Args>
variant call(std::string const &name, Args... args) {
  call_r(name, 0, args);
}
I was too tired yesteday
I am planning to bail out of work a bit earlier today
ofc everything here is trivial compared to what has to be done to achieve something like lua.register_func("myfunc", make_lua_func(&myfunc)); or something
hm
we will need lua::bind
yeah.
or somethink similar
14:32
This is the hardest part and the most important
Maybe we should look at what the boost.python guys did
I don't know; python is a bit different
More complicated, and boost prolly introduced a lot of hacks
I think we should keep this relatively simple
Sure; this is why we use lua in the first place isn't it?
14:34
I mean we could look at how boost.python binds native functions because I have honestly no idea how to do it
there's a way to register C function for lua
this function should return int and take lua_State* as the only parameter
I know :)
so we just need to bind user functions into this
I think we could build our own trivial functor class
Can we use boost::function?
with implicit cast operator to lua_function, and having an std::function inside
14:36
hmm
isn't boost::function analogical to std::function?
That's very likely
Oh we just need function_traits
what are they, exactly?
There is a template that lets you give a param index as an integer somewhere, eg something like param_type<traits, 3>::type
wow
so you can parse the function template arguments and push appropriate objects on stack
I wonder if we could do stack operations in a way similar to iostreams
so more complicated objects could be exchanged easily
14:48
I'm not sure, I'm not very well versed into TMP
but we might want to give it a try
I am neither :/
well, we will bug Xeo Puppy and Robot if we get stuck
so yeah, I'll try to write my version today
hi @Justin.
okay
@BartekBanachewicz hey - I just stopped by to see what the room is about :)
@JustinMeiners exactly what the title states
@BartekBanachewicz haha yeah I can see that
 
2 hours later…
Ell
Ell
16:50
We don't need our own functor class
We just need a template argument for anything convertible to a function pointer
17:42
no
that would require functions compatible with this
3 hours ago, by Bartek Banachewicz
this function should return int and take lua_State* as the only parameter
which sucks @Ell
Ell
Ell
Well
Hmm.
I'm sure there is a way around it
How are arguments sent? Pushed onto the stack?
yep
how is your prototype going? :)
@Ell yes, functor class
Ell
Ell
17:57
I havent had chance to start to be honest, I've been very busy at school recently
I was at school until 22:30 the other night
Then I had prize night. But today was the last night so hopefully can start soon although my internet is sucking >.<
yea, I am just ripping the extreme TMP code apart
Ell
Ell
18:14
Which bit is that?
Registering functions?
picking overload
I wonder how @kbok did that actually
19:07
owhaowhashas
templatez
hm TIL about Lua registry
I think we can use that to implement functors
I'll start with global functions though
19:47
OMG I am so epic @Ell @kbok
vm.callGlobal("foo", 1, "2", 3.0); works
20:42
hi there
I have just pushed initial version to gh @kbok
20:59
ohoho
> An important concept here is that the stack is not a global structure; each function has its own private local stack.
that is quite interesting
21:14
> [Boost.]Proto is a framework for building Embedded Domain-Specific Languages in C++
ohohohooh
oh yes give me more
 
1 hour later…
22:20
ooh
So you're making a C++ version of Lua?
22:35
well
@Magtheridon96 I guess I've already answered you on Lounge. Didn't notice here :)
but yeah, I said I need that, and kbok and Ell want it too
so we decided to sort of team up
I need that too ^^
@Magtheridon96 after we post some draft on GH, you can follow it
all contributions are of course welcome
Alright
I can image an awesome API, something like:
LUAMachine vm;
vm << "a = 3";
vm << "b = 6";
vm.get("a");
Okay, maybe that's a little too much
But the stream operators are pretty cool for this, because the main class would then clearly be considered a state machine with the ability to take and evaluate code at a whim
22:52
@Magtheridon96 it already works
:)
I mean, not operators
I saw the image
but that's just syntactic sugar
That's wonderful
you can do vm.load("a = 3");
I'm embedding a canvas in my level editor for coding in Lua and I'm going to have to write something to do syntax highlighting soon
There are going to be at least 4 different tabs in it on the same level
22:54
I have used one of my coding minions to write a vim in Lua
I should ask him to add syntax highlighting
My only problem is the fact that I'm using custom GUI classes made from scratch,
so I need to simulate text selection and everything :D
I mean, only font rendering now
what are you using for rendering? OGL?
I'm using SFML, which uses OpenGL for rendering internally
I'm doing it for the Events and Window Management, plus the efficiency
22:56
I use it too now
But I don't use its graphics at all
they are too slow and limited for my needs
Come to think of it, text selection is easy :o
:P
Especially if you mimic how vim does it
upon a mouse button press event, change caret position to a desired position. Upon a mouse move event, if the current state of the left button is clicked, then change a certain position holder to where the caret would go if you were to click on the textbox in the current mouse position
nobody uses mouse for selecting anyway
I learned how to use windows clipboard lately, that seems really nice
woot
Oh I only use selection for when I want to quickly delete lots of shit
and for when I want to Copy/paste stuff
(I don't right click, I use the keys)
23:01
so fuck mouse selection
YAGNI
I have a working textbox, but not a canvas
For that, I would need to code a GUIScrollbar too
Scrollbar is easy
I have a GUIScroller for things like Volume scrollers and shit
Ooh, nice
All I would need to do is copy the GUIScroller class and turn it into a ScrollBar class, then delete most of the code int he GUIScroller class after making it derived from the ScrollBar :D
The only difference between them would be that GUIScroller renders a fill
Actually, fuck that, that's not the right behavior
class GUIScrollBar : public GUISlider {} makes more sense come to think of it
What sources did you use to learn OpenGL? I need to get into it soon. For C++, I used a book written by Paul Deitel
23:18
@Magtheridon96 oh, various.
open.gl is nice for start
I can always try to help if you need some.
I happen to know some things about OpenGL
but I'm still a newbie and learning :)
Good thing I actually work with it.
Thanks for the link, that first site looks quite legit :D
I think I fail on the graphics card criterion though
Holy fuck
I have OGL version 1.1 and that's the latest version that my graphics card supports
FML
23:46
@Magtheridon96 the second is much better :P
anyway, yeah, you need better gpu
I guess I can stick to SFML for now
My codebase is fucked up currently anyway
well, until you have a GPU that supports shaders
because half of it uses SDL
Been working on it entirely for a week
23:48
no programmer will say that his codebase is good
(the conversion)
SDL is C. /topic
I was able to get rid of a ton of shit though
I had a Graphics class for scaling, rotating and lots of other things
currently, it's a Singleton used for loading sprites, textures and images
and I don't even need to free them
Singleton
:cripes:
Please don't.
23:51
Singletons are bad.
Fine, I'll change it from class Graphics to namespace Graphics
no.
class Graphics is OK
just create a goddamn instance
anyway, that's not a good room for that
we already spammed too much
So, Graphics::getInstance().loadTexture("image.png")?
@Magtheridon96 no. Go to Lounge and ask guys.
Okay, hopefully, they won't scream at me :D

« first day    last day (49 days later) »