C++ Thread

I’ve had a few people PM me about C++ questions so I was wondering…

How many of you would like a C++ Thread here where I (and anyone else that wants to help), answers questions and puts up tutorials to help anyone who wants to learn?

+1 to that! I would.

I think it would be beneficial, just not sure as to how many people would see it that way. I for one can say if I see some 2-3 min answer type questions I’d have no issues popping in to point ppl in the right directions.

I’d help out. I could even help out with any simple objective C questions if they pop up.

Thanks for the help inputs lol. I don’t know if I should just start posting tutorials, or just wait for questions. But anyway, anyone have any questions?

One thing I’ve been curious about is reflection. I haven’t done a lot of research into it yet but have you used any of the libraries people have made and if so any comments on their ease of use (or pain).

Can’t say that I ever used it. I am reading up on it now, looks interesting. I’ll mess around with it a little and see what I can come up with, hopefully I can get you an answer.

I’m a C/C++ coder as well. Sure - I’d like a C++ thread.

i know a bit of c++ and would like to learn how to program for blender.

Ok, if I am reading this correctly, it looks as though reflection just returns the data type of the variable in question. If your using Windows and Visual Studio, include the namespace system, and when you want to use reflection simply use ->GetType:

using namespace System;

int a = 5;

cout<<"a is of type “<<a->GetType<<” and equals "<<a<<endl;

This is, of course, assuming your using VS and windows, I have a tiny bit of experience programming in Linux.

Is this what you were looking for, or is it something else?

Edit: This seems to be a better solution that isn’t platform dependent: http://www.extreme.indiana.edu/reflcpp/

Like I said, I have not experience with reflection, but what I get out of reading some site is, its like a pointer, only it doesn’t return data, only the data type that the variable is.

Yeah thats part of what reflection does. Its more about dynamic executable code loading. It differs from a DLL because it does not need an interface definition at compile time. IUnknown supports that kind of functionality though its query function call.

But yeah I’m still learning this stuff too.

This was a good read on the subject:

Ah, I hate when there are 1 name for like 3 different things. I am finding all kinds of different information on reflection. I see they are all custom made files though, because C++ doesn’t natively support it.

I have been starting to code some things for blender (nothing special yet). The best thing you can do, is get the code and look through it. It is very well commented and documented. It’s pretty easy to follow too. Right now, I don’t really know how to help you, once I actually do something worth posting, I will write some tutorials on how to do basic things (I can’t seem to find any tutorials so I will try and create some). If you are looking through and find something you don’t understand, I will gladly explain it to you though.

If you know C++ the Game Engine part of Blender could use optimization and better/more logic functions/bricks and graphics, they could use more developers.

One of the reasons I wanted to start this thread. I figured all these people asking me questions could be future Blender developers. I’m working on some things now, haven’t looked at the BGE yet. I’ll get to that once I have a strong grasp on the base code.

That’s be cool - I’ve always had an interest in C++.

Hey this thread will help me, thanks

Its worth noting that blender is a mix of both C++ and C. Core parts of blender have no C++ in it (or at least that was the case a year ago). Some parts such as the rendering engine does use C++ though.

C++ compiler is not 100% C compatible, This pages does a good job covering the differences between the two languages.

Therefor there is a branch in blender where part of it is compiled as C and the other part C++.

I would like to start leaning but have no idea where to go. I eventually plan to learn to code for blender but I have a feeling it might take me a few years.

Start small. Work on learning variable types and how much memory they take up. Start with hello world tutorials and work your way up from there. Maybe I’ll post a tutorial everyday (starting for absolute beginners and work my way up from there). Ill keep posting tutorials but if anyone has any other questions they can ask them. We’ll start tomorrow!