Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 12, 2013, 05:31:33 AM |
|
Considering there are clearly tons of programmers/learning programmers here I think we should make a thread where we can talk about different programming languages and help each other out, I'm currently messing around in OpenGL though I suspect if I want to make anything functional like a game I'm going to have to properly get into C++ too, feel free to post code here of stuff you're working on and need help with etc.
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity(); glPushMatrix(); glTranslatef(-0.5f, -0.5f, 0.0f); glPushMatrix(); glRotatef (90.0f, -180.0f, 0.0f, 0.0f); glPopMatrix();
glBegin(GL_TRIANGLES);
glVertex3f(0.5f, 0.5f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.5f, 0.5f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(0.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f);
glVertex3f(0.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.5f, 0.5f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f);
glVertex3f(0.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.0f, 1.5f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f);
glEnd();
glPopMatrix();
I made a pink pentagon, WEEEEEEEEE! Can't figure out how to get GLRotatef working though.
|
|
|
|
Este Nuno
Legendary
Offline
Activity: 826
Merit: 1002
amarha
|
|
May 12, 2013, 01:28:27 PM |
|
Nothing to add atm, but I support this idea for a thread.
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
May 12, 2013, 01:34:30 PM |
|
Purely from a C++ coding style perspective I see no reason to be "indenting" the function calls you have (indenting is normally done for code *blocks* that are surrounded by braces or for conditional expressions). You might consider using an "empty code block" to make it more express the indenting you are after though: ... glPopMatrix(); { glBegin(GL_TRIANGLES); ... glEnd(); }
|
|
|
|
jackjack
Legendary
Offline
Activity: 1176
Merit: 1260
May Bitcoin be touched by his Noodly Appendage
|
|
May 12, 2013, 01:52:28 PM |
|
I support a coding (sub-)FORUM
|
Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2 Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
|
|
|
BitshireHashaway
|
|
May 12, 2013, 07:20:32 PM |
|
I am interested in learning C++ mainly because that seems to be the most widely used language out there. I am already familiar with HTML because I've learned it some in school and have used it in creating my websites, and next year, I will be learning some Java as part of a course and will probably continue to mastery the following year. However, C++ I will need to learn by myself, so do you guys have any recommendations for me learning it by myself. My parents may help me as they both know C++ and multiple other coding languages.
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
May 13, 2013, 02:09:21 AM |
|
I would recommend reading Scott Meyers and Herb Sutter and keeping your focus on Standard C++ always (i.e. not extensions for specific compilers such as MSVC). BTW - https://bitcointalk.org/index.php?topic=203104.0.
|
|
|
|
adamstgBit
Legendary
Offline
Activity: 1904
Merit: 1037
Trusted Bitcoiner
|
|
May 13, 2013, 02:38:35 AM |
|
i can do the job 2 of 3 ways; Cheap, Fast, Good if you want it: Cheap & Fast, fine, but it won't be very good.. (Dirty Code! lol ) Good & Cheap, ok, ill do my best! Good & Fast, sure, but thats not going to be cheap. 50,000BTC
|
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 14, 2013, 06:44:16 PM |
|
Have to admit, I think I'm starting to really enjoy messing around in OpenGL I just need to figure out how to make it interactive. glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity(); glPushMatrix(); glTranslatef(-1.0f, -1.0f, 0.0f); glPushMatrix(); glRotatef (90.0f, -180.0f, 0.0f, 0.0f); glPopMatrix();
glBegin(GL_TRIANGLES);
glVertex3f(0.5f, 0.5f, 0.0f); glColor3f(2.0f, 0.5f, -1.0f); glVertex3f(1.5f, 0.5f, 0.0f); glColor3f(1.0f, 0.5f, -1.0f); glVertex3f(0.5f, 1.0f, 0.0f); glColor3f(6.0f, 0.5f, -1.0f);
glVertex3f(0.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, -1.0f); glVertex3f(1.5f, 0.5f, 0.0f); glColor3f(2.0f, 0.5f, 1.0f); glVertex3f(1.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f);
glVertex3f(0.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.5f, 1.0f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f); glVertex3f(1.0f, 1.5f, 0.0f); glColor3f(1.0f, 0.5f, 1.0f);
glEnd();
glPopMatrix();
Coding spam woopeee!
|
|
|
|
raze
|
|
May 15, 2013, 03:52:17 AM |
|
Just remember it's not the language that matters (okay, maybe it matters a little), it's the practices and techniques you learn from using that language. If you master the correct techniques, you'll pick up future languages faster, and produce better code and documentation.
|
BTC --16FPbgyUZdTm1voAfi26VZ3RH7apTFGaPm LTC -- Lhd3gmj84BWqx7kQgqUA7gyoogsLeJbCXb PPC -- PRpKGjgjNLFv8eR7VVv7jBaP8aexDFqk4C
|
|
|
Elwar
Legendary
Offline
Activity: 3598
Merit: 2386
Viva Ut Vivas
|
|
May 15, 2013, 04:32:05 AM |
|
Have to admit, I think I'm starting to really enjoy messing around in OpenGL I just need to figure out how to make it interactive. I did some coding in OpenGL, it is pretty fun. I had to open up some of my old math books from college that I figured I would never need again. For interaction, you should first start with using a key listener. Making stuff happen based upon various keyboard keys is fairly easy.
|
First seastead company actually selling sea homes: Ocean Builders https://ocean.builders Of course we accept bitcoin.
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 15, 2013, 09:21:56 AM |
|
I dunno about that, I don't think I want to use anything particularly pre-made I think the only thing I've done that's pre-made so far is use the Codeblocks OpenGL sample to get all the window setup that I need because the tutorials I've looked at are outdated with some of the stuff they have. I did notice some VK commands for all the keyboard stuff in the compiler so I'll have to have a look at the syntax involved with that so I can make stuff move. Edit: AHA! Nehe seems to be very good with this stuff and it's just what I need, IF commands ftw!
|
|
|
|
|
Welsh
Staff
Legendary
Offline
Activity: 3304
Merit: 4115
|
|
May 15, 2013, 09:56:41 PM |
|
It would be really great if this got added as a sub-forum. I know it can be related to services etc. But, this just seems like a great way to break it up from the other things located in other sections, however I don't have anything to add at this moment as i'm mainly a python programmer, and learning java now.
|
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 15, 2013, 09:58:48 PM |
|
Lets spam code all over this thread so the mods know there's demand for a category lolollool
|
|
|
|
Illimensky
Newbie
Offline
Activity: 56
Merit: 0
|
|
May 15, 2013, 10:53:29 PM |
|
Nobody here's programming in LOLcode? Seriously? You should all try it. Wikipedia: http://en.wikipedia.org/wiki/LOLCODEThe Hello World program: HAI CAN HAS STDIO? VISIBLE "HAI WORLD!" KTHXBYEAs you can see, its insane efficiency at any task combined with its extreme brevity makes it a must for any real coding project.
|
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 16, 2013, 03:24:46 PM |
|
Bah, does anyone know some good tutorials that show you how to combine OpenGL and C++ while I'm searching for them myself? The OpenGL tutorials are great and I have an easy time drawing basic stuff on it now but I need to look up how to properly combine everything so I can interact with the shapes I make
|
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 16, 2013, 03:34:08 PM |
|
|
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 17, 2013, 01:48:06 AM |
|
glClearColor (0.0f, 0.0f, 0.0f, 0.0f); glClear (GL_COLOR_BUFFER_BIT);
glPushMatrix (); glTranslatef (-0.2f, 0.0f, 0.0f); glRotatef(theta, 0.0f, 1.0f, 0.0f); glBegin (GL_QUADS); glVertex3f (0.0f, -0.1f, 0.0f); glVertex3f (-0.1f, 0.0f, 0.0f); glVertex3f (0.0f, 0.1f, 0.0f); glVertex3f (0.1f, 0.0f, 0.0f); glEnd (); glPopMatrix (); glPushMatrix (); glTranslatef (0.1f, 0.0f, 0.0f); glRotatef(theta, 0.0f, 1.0f, 0.0f); glBegin (GL_QUADS);
glVertex3f (0.0f, -0.1f, 0.0f); glVertex3f (-0.1f, 0.0f, 0.0f); glVertex3f (0.0f, 0.1f, 0.0f); glVertex3f (0.1f, 0.0f, 0.0f); glEnd (); glPopMatrix ();
SwapBuffers (hDC);
theta += 1.0f; Sleep (1); } }
Must make it so I can click and drag these spinning squares
|
|
|
|
Lethn (OP)
Legendary
Offline
Activity: 1540
Merit: 1000
|
|
May 17, 2013, 05:00:39 PM |
|
Does anyone know of any up to date syntax for GLFW keyboard and mouse input? Or would you recommend something else? I'm searching around but I think I could use some help on this one.
|
|
|
|
Welsh
Staff
Legendary
Offline
Activity: 3304
Merit: 4115
|
|
May 17, 2013, 05:50:09 PM |
|
print("We want a sub-forum") user_input = input("What do you say staff?")
|
|
|
|
|