[QUOTE=ThatLuaCoder;31680809]Great read! To bad I can't compile. You will be writing the guide for Linux too right? :>[/QUOTE]
Yes, I'll start writing the Linux guide tomorrow. I've never been able to install Mac OS X, so someone else will have to do that. After polishing both the windows and linux context creation chapters, I'll start working on the drawing chapter.
[QUOTE=SupahVee;31674893]I would avoid sorting by draw order every frame. Just sort whenever a new entity is created.
(If you want to optimize it even more, have something like an hashtable<int, vector<entity>>, and then draw in the order of the hashtable keys. Insert entities in the hashtable only on creation.)
I'm not used to c++ so I don't see any possible error. Have you tried profiling / commenting certain parts of the code to see what the bottleneck is?[/QUOTE]
I don't sort every frame I only sort when DrawSortRequired is true (which is when a new enity is created) I didn't think 3000 entities was too bad, would be interested to know what other people have achieved from SFML.
I'm PUI here so forgive me if I sound a bit retarded.
Nevermind.
I'm just wondering how hard it would be for me to learn c++, as I am pretty good at C# and java now (I know they are basically the same)
But has anyone of you guys learned c++ AFTER c#?
Cuz I didn't need it til now, since I' almost entirely using XNA.
Oh and I have ofc. looked at starter tutorials, but understanding the syntax was really not that hard, just haven't coded anything yet,
because all of the c++ tutorials start with console applications and cout << blabla.
[QUOTE=CarlBooth;31667766]Dear Microsoft'll,
[url=http://en.wikipedia.org/wiki/Jim%27ll_Fix_it]Can you fix it for me[/url] to have an XNA project template for Visual Studio named "Windows Game (4.0, No Comments)"
If you add this template you can remove the frankly ludicrous amount of comments you have in the default one.
[img]http://i.imgur.com/cx52m.png[/img]
I feel that anyone with a gram of common sense can work out what your rather aptly named [I]UnloadContent()[/I] function does.
Thanks
Carl
Age 8 ¾
[editline]11th August 2011[/editline]
P.S.
I drew you a picture of how you think it will look
[img]http://i.imgur.com/F87Is.png[/img][/QUOTE]
This just made me think how useful it would be if you could add little tags to a line of code that acted like a bookmark that was displayed in a column on the side of visual studio. It would make it much faster to scroll through code.
Is there anything like this in Visual studio, or a plugin of some sort.
Success! I also made it so the message box would tell me my major and minor versions :eng101:
[img]http://dl.dropbox.com/u/8508508/openglSuccess.png[/img]
However, when I close it, the process doesn't seem to end. Probably messed up the window procedure function somewhere.
Thanks Overv for that chapter. I liked the way how you didn't feel the need to explain everything at once and opted to use the DefWindowProc instead of just starting to make your own window procedure function. I think that this pace will help beginners feel more comfortable as they aren't being bombarded by a ton of information to chew on at once.
[QUOTE=Overv;31680817]Yes, I'll start writing the Linux guide tomorrow. I've never been able to install Mac OS X, so someone else will have to do that. After polishing both the windows and linux context creation chapters, I'll start working on the drawing chapter.[/QUOTE]
I can help with that crazy markup if you'd like. :v:
[QUOTE=conman420;31672740]Just got my game to a working and fast state (I hope!), using SFML2.
[img]http://dl.dropbox.com/u/3715122/TankEngine.PNG[/img]
3000 entities and still running at 30 fps, I am pretty pleased with that! The grass is 3000 sprites bouncing around the world.[/QUOTE]
Why are there 3000 entities there? There should be three.
[editline]11th August 2011[/editline]
[QUOTE=Overv;31680817]Yes, I'll start writing the Linux guide tomorrow. I've never been able to install Mac OS X, so someone else will have to do that. After polishing both the windows and linux context creation chapters, I'll start working on the drawing chapter.[/QUOTE]
I've got a Macbook Pro, it's running Arch right now, but I think I could help you out if you can't find anyone else.
[QUOTE=Jawalt;31682328]Why are there 3000 entities there? There should be three.[/QUOTE]Well, the entity counter says 3005...
I'm pretty sure that the grass is just a massive blob of greenish entities. I don't think it was meant as a demonstration of how to best add grass to a game.
Quick question Overv, will Open.gl have GLSL stuff in the drawing polygons chapter? Because in my incomplete knowledge, I got the impression that you need to use GLSL to render shapes. (I'm probably wrong but GLSL has just interested me for a while and I just want to know early on :smile:)
[QUOTE=awfa3;31682887]Quick question Overv, will Open.gl have GLSL stuff in the drawing polygons chapter? Because in my incomplete knowledge, I got the impression that you need to use GLSL to render shapes. (I'm probably wrong but GLSL has just interested me for a while and I just want to know early on :smile:)[/QUOTE]
Programmable pipeline requires you to write your own shaders, so yes.
[QUOTE=Overv;31680352]I agree, I'll try to implement that functionality tomorrow. Chapter 2 is now [url=http://open.gl/?page=context]available[/url]. I'll read through it tomorrow and correct any mistakes I find and any pointed out by you.[/QUOTE]
The only way to make my window clear to red is by commenting out the "WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB" flag in the context attributes. Does this mean I have an outdated graphics card? Is this purely a developer problem or would you have to disable it for outdated end users as well? I check my OpenGL version and it says it is 3.3 but the Nvidia page says its 2.1.
edit:
also
[cpp]
if (msg.message == WM_QUIT)
return msg.lParam;
[/cpp]
needs to be in the second while loop in your released source code its in the first, which is why I think awfa3 was having problems.
[QUOTE=awfa3;31681857]
However, when I close it, the process doesn't seem to end. Probably messed up the window procedure function somewhere.[/QUOTE]
Try to add exit(1); after PostQuitMessage, or just stop calling Translate/DispatchMessage after you close it. That would require an extra variable though, I guess.
Oh wow, just noticed some stupid behaviour in Ruby. Turns out that if you want to find the last element of an array, it's ~20% faster to index it with -1 and ~12% faster to get the length, subtract one and index it than to call the Array#last method.
It may not seem like much, but I replaced out all the calls to Array#last with Array#[-1] and this parser I'm writing is now roughly 10% faster on 4.5MB of sample data (down from 15.4 sec to 14.1 sec)
Just read a bit at open.gl, and I just have to say, this is a [b]really[/b] messy type name:
[code]PFNWGLCREATECONTEXTATTRIBSARBPROC[/code]
[QUOTE=thf;31685264]Just read a bit at open.gl, and I just have to say, this is a [b]really[/b] messy type name:
[code]PFNWGLCREATECONTEXTATTRIBSARBPROC[/code][/QUOTE]
That's why I always write extremely convenient wrapper classes :3
[QUOTE=thf;31685264]Just read a bit at open.gl, and I just have to say, this is a [b]really[/b] messy type name:
[code]PFNWGLCREATECONTEXTATTRIBSARBPROC[/code][/QUOTE]
I'm not a C++ programmer or a OGL programmer, but can't you use capitals and lower case characters?
You know, PFNWGLCreateContextAttribsARBProc or at least SOMETHING better than that mess.
All winapi structs are caps.
I'd prefer pfn_wglCreateContextAttribsARBProc, but that again would mean it's a variable, not a struct. Whatever.
[QUOTE=wingless;31686210]I'm not a C++ programmer or a OGL programmer, but can't you use capitals and lower case characters?[/QUOTE]
No, C++ type names are restricted to uppercase ASCII characters only, and they MUST always contain exactly 33 characters. If the type is a pointer, they must contain the letter P (the letters L and F must be used to indicate long and far pointers respectively).
[QUOTE=polkm;31684967]The only way to make my window clear to red is by commenting out the "WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB" flag in the context attributes. Does this mean I have an outdated graphics card? Is this purely a developer problem or would you have to disable it for outdated end users as well? I check my OpenGL version and it says it is 3.3 but the Nvidia page says its 2.1.
edit:
also
[cpp]
if (msg.message == WM_QUIT)
return msg.lParam;
[/cpp]
needs to be in the second while loop in your released source code its in the first, which is why I think awfa3 was having problems.[/QUOTE]
No, he was passing the handle of his window to PeekMessage, that's why he didn't receive WM_QUIT after destroying his window.
Which graphics card do you have?
[QUOTE=awfa3;31682887]Quick question Overv, will Open.gl have GLSL stuff in the drawing polygons chapter? Because in my incomplete knowledge, I got the impression that you need to use GLSL to render shapes. (I'm probably wrong but GLSL has just interested me for a while and I just want to know early on :smile:)[/QUOTE]
Yup.
[QUOTE=thf;31685264]Just read a bit at open.gl, and I just have to say, this is a [b]really[/b] messy type name:
[code]PFNWGLCREATECONTEXTATTRIBSARBPROC[/code][/QUOTE]
It's the same story throughout the entire Win32 API pretty much, same with DirectX as well. Microsoft sure love their capitals :v:
[QUOTE=conman420;31673621]I'm running in release. Debug mode is much much slower though.
[cpp]
...
[/cpp]
Heres my main game loop, if you see anything obviously slow :)[/QUOTE]
Just wondering, how does the CreateEntity() function map the string "ent_test" to a corresponding class?
[img]http://img215.imageshack.us/img215/4908/ss20110812140038.jpg[/img]
Small tank I made, it can move, turn, top can turn. Only problem is the bullets, they come from the wrong direction and don't have the right angle.
Alot of thanks to the guys at FP Programmers chat, and Devbug for the bullet part.
[QUOTE=polkm;31684967]The only way to make my window clear to red is by commenting out the "WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB" flag in the context attributes. Does this mean I have an outdated graphics card? Is this purely a developer problem or would you have to disable it for outdated end users as well? I check my OpenGL version and it says it is 3.3 but the Nvidia page says its 2.1.
edit:
also
[cpp]
if (msg.message == WM_QUIT)
return msg.lParam;
[/cpp]
needs to be in the second while loop in your released source code its in the first, which is why I think awfa3 was having problems.[/QUOTE]
Use this to check what openGL version you can use [url]http://www.realtech-vr.com/glview/[/url]
[img]http://img810.imageshack.us/img810/9173/47637044.png[/img]
Overv you mght want to include this in the first chapter or something, its a very useful tool
Dont know why it says DirectX is 9, dxdiag says its 11 (which it cant be either because its a laptop gcard) and the website said it supported dx 10
[QUOTE=Staneh;31687170][img]http://img215.imageshack.us/img215/4908/ss20110812140038.jpg[/img]
Small tank I made, it can move, turn, top can turn. Only problem is the bullets, they come from the wrong direction and don't have the right angle.
Alot of thanks to the guys at FP Programmers chat, and Devbug for the bullet part.[/QUOTE]
bulletX = centerX + radius * cos(angle)
bulletY = centerY + radius * sin(angle)
bulletAngle = angle
[QUOTE=SupahVee;31687212]bulletX = centerX + radius * cos(angle)
bulletY = centerY + radius * sin(angle)
bulletAngle = angle[/QUOTE]
I'm not sure, what exactly is the radius?
[QUOTE=Staneh;31687287]I'm not sure, what exactly is the radius?[/QUOTE]
The distance from the center of the turret to the barrel end, I guess.
I'd prefer
[cpp]
vec fwd = Turret.Forward();
Bullet.SetPos(Turret.GetPos() + fwd*Turret.Size() + fwd*Turret.BarrelLength());
Bullet.SetDir(fwd);
[/cpp]
<snip I was wrong :v:>
Okay, I got this atm:
[cpp] this.bullets.AddLast(new Bullet(velocity, new Vector2(tanktop.Width / 2 + tanktop.Width / 2 - 75 * (float) Math.Cos(ttangle), tanktop.Height / 2 + tanktop.Width / 2 - 75 * (float) Math.Sin(ttangle)), 10.0f, ttangle));[/cpp]
Now, this code shoots bullets everywhere and nowhere, there is something wrong
[QUOTE=thf;31685264]Just read a bit at open.gl, and I just have to say, this is a [b]really[/b] messy type name:
[code]PFNWGLCREATECONTEXTATTRIBSARBPROC[/code][/QUOTE]
It may be messy, but you'll only have to look at it once. As soon as you've loaded the function, you just call it like any other function and you don't have to care about the type anymore.
Sorry, you need to Log In to post a reply to this thread.