• What do you need help with? Version 5
    5,752 replies, posted
[QUOTE=esalaka;36054542]For the love of god please never use system ever except in dire situations where it is literally the only choice[/QUOTE] Which is never, right, because you can always just code the required functionality in the program yourself. Except for application launchers of course.
I'm seeing stuff like this in some C osdev: [cpp] temp >> 8 attrib << 8 [/cpp] What are these and what do they do?
A bitwise shift, basically it moves all the bits to the right or left by the specified amount. [url]http://en.wikipedia.org/wiki/Bitwise_shift#Bit_shifts[/url]
Another assembly question: What's [code]movl %eax, -4(%ebp)[/code] in Intel syntax. I understand that this code assigns eax to the position of register ebp, minus 4, but ebp-4 doesn't work in NASM, does it?
How exactly can one use SFML with Netbeans? I like Netbeans and am really turned off by Visual Studio at the moment, so any help would be appreciated. I've added SFML 1.6's include directories and set the -L option on g++ to the library folder for SFML 1.6. Right now it does the correct code highlighting, suggests the right libraries etc., but will not compile. Example: [code]warning: SFML/Window.hpp: No such file or directory[/code] I Google'd this and there was actually a previous Facepunch thread about it, but the guy's question was never answered. The best answer was "just use Code::Blocks".
I'm trying to read a text file in java and tokenize each line and do a simple comparison of the last element on the line with a string. But it just won't work! The last element in the file is either IG, G, VG or MVG and I compare it in an if-else chain against "IG", "G" etc. but it doesn't match any of those... Code: [url]http://pastebin.com/i5D4Tya5[/url]
So, yeah, I don't know why SFML has such shitty documentation. Alas, once more, I need some help. I need to create a program that has the File toolbar functionality of Win32, but has SFML's / OpenGL's rendering capabilities. I used [url=http://www.youtube.com/watch?v=Ne8-gSmRm2A&feature=autoplay&list=SPC616A3733AB5F923&playnext=2]these video tutorials[/url] for powering through the basics of Win32, and then tried to use SFML's tutorials on integrating SFML with Win32. However, like always, the documentation is piss-poor and doesn't tell you half of what you need to know, or need to do. For example: where to put any of the shit. I am using Visual C++ 2008 Express, and am going about it as that video tutorial does, which is to say I am creating a "Win32 Project." With that in mind, what all do I have to do to create a single OpenGL / SFML render port, the size of the full screen, minus the File toolbar? I've tried Googling it, and can't find much of anything (other than people saying to use the SFML documentation - one guy even said that said documentation is good; I guffawed for a good five minutes at that. I had no idea programmers could be stand-up comedians, too!) Also, for SFML, is there anything else I need to do other than put the dependencies in the Linker? It's been too long since I've done this (this is an aside from my other SFML project, though they are related). Thanks in advance, guys. :v:
[QUOTE=Armandur;36065037]I'm trying to read a text file in java and tokenize each line and do a simple comparison of the last element on the line with a string. But it just won't work! The last element in the file is either IG, G, VG or MVG and I compare it in an if-else chain against "IG", "G" etc. but it doesn't match any of those... Code: [url]http://pastebin.com/i5D4Tya5[/url][/QUOTE] Debug it, print out what bI is and you would get a clue about the problem. [editline]23rd May 2012[/editline] [QUOTE=WTF Nuke;36057410]I keep giving up on projects, mainly because I get frustrated or bored with the concept. I want to start a new one, write up a document and make all the major decisions first before I start writing code so I don't have to rewrite basic code over and over, as I have had to do. The problem is I want to make this game 3d. A survival zombie game (yes I know it's cliche and overdone but I think it'll be fun to make) where you have to live in a city that is I am legend esque, finding supplies and steering clear of dark buildings, and hiding in your house at night. The problem with 3d is I have never done it. I am frightened by the art required, and by the whole animation and texture idea. I am afraid that I won't get anything done apart from making blobs that move around. My questions is this: how easy is it to create animations and models for 3d games, and are there any tutorials on this matter?[/QUOTE] It is hard, very hard and yes, there are tutorials. I used to have some good blender tutorials but no idea what happen to them. For now, I can just recommend a search for the Blender tutorial noob to pro. You can use other programs than Blender of course, but that might most likely cost a lot of money. [editline]23rd May 2012[/editline] [QUOTE=Gmod4ever;36068718]Text[/QUOTE] Maybe that do not help you so much, but begin to make a basic Win32 window and render the SFML stuff into it and the add the menu in the way the video tutorial describes (not seen it but I assume it is about making a menu).
I don't have much of an answer to your toolbar question, but the SFML documentation is good and I have never had any problems with it, and am unsure what you're complaining about. It's all there, you just have to search for it a little.
[QUOTE=WTF Nuke;36069149]I don't have much of an answer to your toolbar question, but the SFML documentation is good and I have never had any problems with it, and am unsure what you're complaining about. It's all there, you just have to search for it a little.[/QUOTE] No, it really isn't that great. For example. Where does [url=http://www.sfml-dev.org/tutorials/1.6/graphics-win32.php]this code[/url] go? It doesn't explain at all where this shit goes. I tried putting the stuff in haphazardly, but that predictably failed. I also downloaded the code at the bottom, and replaced my main .cpp with it, but it spat errors at me about skipping the header or something. And yes, I did link all the libraries. It does [b]not[/b] tell you what all you need to do. It tells you most of it, but assumes you know the rest, which is an ass-backwards approach for a tutorial, because the whole point of following a tutorial is you [b]don't[/b] know what you're doing. The documentation is nice [b]for most things[/b], don't get me wrong, but if you can't see how it has huge fucking gaping holes where a lot of useful / required information should be, then either you're just too proficient at it (RE: don't actually need the tutorials) or you don't use it at all.
I downloaded Love2d 0.8 and I'm very confused. The wiki doesn't seem to actually explain anything (except specific functions). They talk about callbacks and whatnot and that it needs a main.lua file, but they don't explain the actual game layout. So yeah I have a main.lua file, now what? Don't I need some sort of main loop/event loop thing? Edit: okay so what I think now is that the constant function definitions are actually things you "add" to callback functions (functions that are in the event loop or w/e). So now I'm gonna try and just make it display the time to get a sense of framerate, updating the screen and whatnot...
[QUOTE=Number-41;36069444]I downloaded Love2d 0.8 and I'm very confused. The wiki doesn't seem to actually explain anything (except specific functions). They talk about callbacks and whatnot and that it needs a main.lua file, but they don't explain the actual game layout. So yeah I have a main.lua file, now what? Don't I need some sort of main loop/event loop thing?[/QUOTE] LOVE isn't a game, or a game maker (at least, not explicitly. While people usually use it for games, you can make other things in it, too). The functions love.draw() and love.update() will be your main controls. Draw is for drawing (obviously), and update is for all the thinking. In fact, just look here. [url]https://love2d.org/wiki/love[/url] You want to look at the "Callbacks" section. Those are all your hooks.
My apologies, I have just used it for the usual rendering stuff, and have not had issues with it. Quick question concerning OpenGL. So basically, an array buffer is a list of all the vertcies (or really any information), and this can be optimized by storing common points(or colours or something) and then creating data using those points (which are referred to by number in a vertex buffer object)?
[QUOTE=Gmod4ever;36069336]No, it really isn't that great. For example. Where does [url=http://www.sfml-dev.org/tutorials/1.6/graphics-win32.php]this code[/url] go? It doesn't explain at all where this shit goes. I tried putting the stuff in haphazardly, but that predictably failed. I also downloaded the code at the bottom, and replaced my main .cpp with it, but it spat errors at me about skipping the header or something. And yes, I did link all the libraries. It does [b]not[/b] tell you what all you need to do. It tells you most of it, but assumes you know the rest, which is an ass-backwards approach for a tutorial, because the whole point of following a tutorial is you [b]don't[/b] know what you're doing. The documentation is nice [b]for most things[/b], don't get me wrong, but if you can't see how it has huge fucking gaping holes where a lot of useful / required information should be, then either you're just too proficient at it (RE: don't actually need the tutorials) or you don't use it at all.[/QUOTE] The problem isn't the documentation, it's that you're expecting too much from it. Library documentation does not provide you with copy and paste epic games, you have to understand the language and how it works before you can use them properly. That documentation is perfectly clear to me.
[QUOTE=Gmod4ever;36069336]No, it really isn't that great. For example. Where does [URL="http://www.sfml-dev.org/tutorials/1.6/graphics-win32.php"]this code[/URL] go? It doesn't explain at all where this shit goes. I tried putting the stuff in haphazardly, but that predictably failed. I also downloaded the code at the bottom, and replaced my main .cpp with it, but it spat errors at me about skipping the header or something. And yes, I did link all the libraries. It does [B]not[/B] tell you what all you need to do. It tells you most of it, but assumes you know the rest, which is an ass-backwards approach for a tutorial, because the whole point of following a tutorial is you [B]don't[/B] know what you're doing. The documentation is nice [B]for most things[/B], don't get me wrong, but if you can't see how it has huge fucking gaping holes where a lot of useful / required information should be, then either you're just too proficient at it (RE: don't actually need the tutorials) or you don't use it at all.[/QUOTE] That page quite explicitly says "[B]If you are not familiar to Win32 interfaces you can first read a tutorial about it, as we won't explain Win32 programming in this tutorial, only the way to put SFML into Win32 controls.[/B]" right at the top. It assumes knowledge of how to create a Win32 API window without SFML first. All the tutorial there will do is teach you how to integrate SFML with the window code you already have.
[QUOTE=Gmod4ever;36069520]LOVE isn't a game, or a game maker (at least, not explicitly. While people usually use it for games, you can make other things in it, too). The functions love.draw() and love.update() will be your main controls. Draw is for drawing (obviously), and update is for all the thinking. In fact, just look here. [url]https://love2d.org/wiki/love[/url] You want to look at the "Callbacks" section. Those are all your hooks.[/QUOTE] Yeah I'm not expecting it to pop out a game (for all I know I might make a function grapher :v: ), just not very familiar with programs other than console things that spew out integrals and other stuff that runs for a while and then stops.
[QUOTE=Chris220;36069578]That page quite explicitly says "[B]If you are not familiar to Win32 interfaces you can first read a tutorial about it, as we won't explain Win32 programming in this tutorial, only the way to put SFML into Win32 controls.[/B]" right at the top. It assumes knowledge of how to create a Win32 API window without SFML first. All the tutorial there will do is teach you how to integrate SFML with the window code you already have.[/QUOTE] Fair enough. Apparently I need to know more than how to create a window. With that being said, you know of any tutorials that will actually help me get to the point where I can integrate this? I don't really give a fuck about learning Win32 - All I want is to have that damn File toolbar (and the associated file browsers) for a program that uses OpenGL. That's it. [QUOTE=Catdaemon;36069551]The problem isn't the documentation, it's that you're expecting too much from it. Library documentation does not provide you with copy and paste epic games, you have to understand the language and how it works before you can use them properly. That documentation is perfectly clear to me.[/QUOTE] Never did I say I expect it to give me "copy and paste epic games," and frankly I feel insulted you think I'm naive enough to think that. Like I said in the first part of this post, all I fucking want is a File toolbar with my program using OpenGL.
WinAPI is godawful It is so godawful Mostly because of Sys Hungarian
Is love.timer.getFPS() an accurate indicator for FPS? I tried to limit my FPS with [lua] function love.update(dt) if dt < 1/30 then love.timer.sleep(0.001) end end [/lua] but love.timer.getFPS() remains unchanged.
[QUOTE=Gmod4ever;36069729]Fair enough. Apparently I need to know more than how to create a window. With that being said, you know of any tutorials that will actually help me get to the point where I can integrate this? I don't really give a fuck about learning Win32 - All I want is to have that damn File toolbar (and the associated file browsers) for a program that uses OpenGL. That's it. Never did I say I expect it to give me "copy and paste epic games," and frankly I feel insulted you think I'm naive enough to think that. Like I said in the first part of this post, all I fucking want is a File toolbar with my program using OpenGL.[/QUOTE] As far as I can tell, the easiest way of doing it is to pretty much work off this minimal example: [url]http://www.codeproject.com/Articles/215690/Minimal-WinApi-Window[/url] From that point onwards, the MSDN is your friend!
[QUOTE=Number-41;36070656]Is love.timer.getFPS() an accurate indicator for FPS? I tried to limit my FPS with [lua] function love.update(dt) if dt < 1/30 then love.timer.sleep(0.001) end end [/lua] but love.timer.getFPS() remains unchanged.[/QUOTE] Can't you use an overlay like FRAPS?
That would complicate things. Tons of games seem to have a built in FPS display (e.g. HL, HL2,...) I also have this: [lua] function love.load() love.graphics.translate(0,-600) love.graphics.scale(1,-1) end [/lua] But that doesn't change my axes...
I'm trying to create and destroy a lot of objects every frame in my game in C++. It's an attempt to implement Bullet's debug-drawer, which gives me objects one primitive at a time (line, sphere, box, etc.) This works fine until I try to draw terrain-collision, which is fed to me one line at a time and can be 7k line primitives+ [b]each frame[/b]. My current debug system takes each primitive request, generates a Vertex and Index buffer and pushes it back into a std::vector. Then, at the end of each frame it sees which ones have expired lifetimes (since it supports long-term objects, not just every frame) and removes those. However, when trying to create and delete 7K+ objects per frame, the std::vector is becoming problematic because of allocation/deconstruction time, even with 10,000 CBaseDebugPrimitive *'s pre-reserved. I know I need to reduce allocations, and reuse existing ones each frame, but I can't come up with a solid solution. If I just pre-allocate say 10,000 lines and keep them in a list, I still have to search through the entire list each time I add an object to find the first free spot, and that becomes slower and slower the more objects there are. Am I missing something obvious? [b]Edit:[/b] I thought about combining like draw-calls into one big set of GPU buffers, but that still has the problem of 'holding' them until the end of the frame, and checking to see if they exist already can be a very slow process. [b]Second Edit:[/b] All of the Bullet demos just use immediate-drawing mode in OpenGL and skip creating a buffer, etc. I'm using directX 10, so this is NOT an option as far as I know.
[QUOTE=Number-41;36075643]That would complicate things. Tons of games seem to have a built in FPS display (e.g. HL, HL2,...) I also have this: [lua] function love.load() love.graphics.translate(0,-600) love.graphics.scale(1,-1) end [/lua] But that doesn't change my axes...[/QUOTE] [lua] function love.draw() love.graphics.translate(0, -600) love.graphics.scale(1, -1) love.graphics.push() -- draw things here love.graphics.pop() end [/lua]
But won't that translate it every frame? Isn't that inefficient? My reasoning is that you set the axes when you load the game, and after that it just stays that way. Also is it true that I have to calculate position, physics stuff in love.update() and purely do the graphical stuff in love.draw() ? The documentation describes each function individually, but says nothing about general layout.
[QUOTE=Number-41;36076458]But won't that translate it every frame? Isn't that inefficient? My reasoning is that you set the axes when you load the game, and after that it just stays that way. Also is it true that I have to calculate position, physics stuff in love.update() and purely do the graphical stuff in love.draw() ? The documentation describes each function individually, but says nothing about general layout.[/QUOTE] How else are you supposed to handle scrolling and zooming? It's fine to call that every frame. And yeah, you should probably do most of the calculating in love.update. Always handle graphics in love.draw. [editline]24th May 2012[/editline] though, I guess you don't have to pop() and push() every frame if it doesn't change or whatever.
I can't for the life of me understand how quadtrees work. Are there any in-depth tutorials out there them in XNA?
[QUOTE=Mr. Smartass;36079966]I can't for the life of me understand how quadtrees work. Are there any in-depth tutorials out there them in XNA?[/QUOTE] You shouldn't need a XNA specific tutorial, it's a data structure. In any case, a "quad""tree" is a tree where for each branch there are four leaves. Or in nerd speak, to each node there are four children. [url]http://en.wikipedia.org/wiki/Quadtree[/url] [url]http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/quadtrees-r1303[/url]
[QUOTE=Topgamer7;36080261]You shouldn't need a XNA specific tutorial, it's a data structure. In any case, a "quad""tree" is a tree where for each branch there are four leaves. Or in nerd speak, to each node there are four children. [url]http://en.wikipedia.org/wiki/Quadtree[/url] [url]http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/quadtrees-r1303[/url][/QUOTE] And for Octrees there's eight instead of four. It's pretty simple really. Can you guess the next in the line?
[QUOTE=T3hGamerDK;36080302]And for Octrees there's eight instead of four. It's pretty simple really. Can you guess the next in the line?[/QUOTE] Hexadectree?
Sorry, you need to Log In to post a reply to this thread.