Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

361 Neutral

About Ademan555

  • Rank
  1. glTexCoordPointer() It takes the same parameters as glVertexPointer (but you point it at your texcoords instead!). Also note: "To enable and disable a texture coordinate array, call glEnableClientState and glDisableClientState with the argument GL_TEXTURE_COORD_ARRAY." Also for future reference, http://www.opengl.org/sdk/docs/man/ should be pretty helpful to you. (The see-also section at the bottom is very helpful if you're not quite sure what it is you need) cheers, Dan EDIT: beaten, also TexCoord not Texcoord, doh!
  2. Ademan555

    Good free python IDE

    I personally use vim which can be customized through plugins to be a very robust python IDE, but people used to classic IDEs will probably hate it, with that in mind, i suggest the eric python ide, or stani's python editor. I'm not sure if stani's will work on windows though...
  3. Ademan555

    Shell scripting is my bane

    What environment are you in? ./mkdir would try and run the file mkdir in the current directory, instead just use mkdir #!/bin/bash echo "Going for $1 connections." x=0 while [[ $x < $1 ]] do x=$(( $x + 1)) DIR="testdata$x" echo "CONNECTION ${i} in "; current="$PWD" mkdir $DIR && cd $DIR && wget http://192.168.x.x/bigwadofdata & cd "$current" done Something like that is probably more what you want. bash scripting isn't exactly my forte either, however, && will run the second command if the first is successful, therefore if your loop fails to create the directory it shouldn't try and change into that directory, nor start wget. note: wget http://blah -O somefile will dump the data to a file of your choosing, which might be more convenient for your purposes. (also [[ ]] allows natural comparison operators, and ends up being much easier on the eyes :-) but I don't know how far back it's supported)
  4. Ademan555

    OpenGL without X11

    Quote:Original post by bloodhound23 How can I do OpenGL with GNOME? Tutorial? You just use Gtkglext... but really it's a deficient library, the "best" way would be to get the x11 window from a gtk widget you were planning to draw on and then to use glx calls to draw on it. (note "best" in this case is very subjective, I just hate the system gtkglext would force you to use (set a timer for a set interval which calls the rendering function) )
  5. I skipped the better half of the thread, but I was very disturbed by what I read from a few people "displaying images and text"... I think the *best* solution is actually to use triangles and whatnot to build your GUI, basically don't rely on anything resolution dependent, you'll have alot more flexibility with, say, svg+cairo, though I can't speak for the speed (I know cairo surfaces can be rendered by opengl though) I may be a bit biased because of what I've seen, I'm SURE that if done right raster based GUI systems can work fine and look great, but what i've seen, especially from CEGUI, is ugly images that don't work correctly together, and far worse, if you use a higher resolution than what was intended, the images end up so that one pixel in the gui image actually covers 16 square "screen pixels" or more, and then you get to see the texture filtering method plain as day, and believe me... it's ugly... I didn't sleep last night so I may not be the clearest but my point is simply take a vector based approach not a raster based one.
  6. Ademan555

    MOD files in python

    Well if you went through the trouble to make a python library out of libmodplug i'm pretty sure the open source community would get on board and start maintaining and whatnot, it seems like a pretty important/basic feature for alot of games (i've sorta decided on mod files for filesize and my love of the classic unreal series :-) ) But I guess my point is just that creating wrappers for python can't be terribly hard, and i think it would be worth it in this case.
  7. Ademan555

    OpenGL book reccomendation

    Ah, I see, you already knew what you were talking about then :-D. Anyways, I don't really know what the best way to go about things is. I think you're *probably* right that you've got the best way to go about things (unfortunately). I'm not entirely sure if it's possible to setup "true" dual head support with glx without Xinerama, but I'm not very well versed in Xlib so I'll shutup now :-p. I didn't really provide any useful information, but I'm going to post anyways, just in case me tossing around the name Xinerama actually turns out to be relevant information lol.
  8. If you're looking for a fast, easy to use matrix library, there's always CML It's open source under the boost software license. You can always use it for inspiration, or even better, use it, and improve upon it :-). I've yet to use it myself honestly, but it looks really good and I'll be using it the next chance I get. I'm not much of a template wizard myself otherwise i'd contribute some code too.
  9. Ademan555

    OpenGL book reccomendation

    Well OpenGL is cross platform, the only thing you might need to learn that is platform specific is the 'glx' family of functions, aside from them you can pick any OpenGL book, I recommend "OpenGL Game Programming" by Dave Astle, it's considered to be the gold standard around here. I develop on linux actually, and I have NEVER touched glx myself(though I've looked it over), I just let SDL handle it for me, that's the method I personally endorse :-), but again, everything else will be cross platform (and the everything else part is far more important for creating fun and exciting games). Learn OpenGL, use either SDL (my vote), GLut, or glfw to handle initilialization, if you ever feel in the future that you (for whatever reason...) need to use glx directly (trust me, you don't need to, and you don't want to) you can just learn that family of functions.
  10. The driver could just have an un-optimized clear function, or maybe the d3d driver is "cheating" and notices you're not drawing anything in between the clears and just skips it. Like everyone else is saying though, this really doesn't mean anything, most games don't clear the screen every frame anyways...
  11. Sorry I had gone to sleep (it was way into the morning hours when i originally posted lol). As far as I know what you described isn't possible :-/ You could do something like this though: std::string word = "[[:alpha:]_]+\\w*"; boost::regex attribute(word + "=\"([^\"]+)\""); Of course that's not as convenient. As far as matching only the first occurrence, I briefly looked through the docs and unfortunately didn't really see anything of the sort. Although if you think about it, I can't imagine that if you hand wrote your own system for iterating through the matches, that it would be faster than what boost came up with, they're generally pretty good about optimizing things (and even if it's not too fast now, it could get way faster without you having to change the code) So really my recommendation is to use their multiple matches system.
  12. HAH! There is a way Quote: Repeated Captures When a marked sub-expression is repeated, then the sub-expression gets "captured" multiple times, however normally only the final capture is available, for example if (?:(\w+)\W+)+ is matched against one fine day Then $1 will contain the string "day", and all the previous captures will have been forgotten. However, Boost.Regex has an experimental feature that allows all the capture information to be retained - this is accessed either via the match_results::captures member function or the sub_match::captures member function. These functions return a container that contains a sequence of all the captures obtained during the regular expression matching. The following example program shows how this information may be used: #include <boost/regex.hpp> #include <iostream> void print_captures(const std::string& regx, const std::string& text) { boost::regex e(regx); boost::smatch what; std::cout << "Expression: \"" << regx << "\"\n"; std::cout << "Text: \"" << text << "\"\n"; if(boost::regex_match(text, what, e, boost::match_extra)) { unsigned i, j; std::cout << "** Match found **\n Sub-Expressions:\n"; for(i = 0; i < what.size(); ++i) std::cout << " $" << i << " = \"" << what << "\"\n"; std::cout << " Captures:\n"; for(i = 0; i < what.size(); ++i) { std::cout << " $" << i << " = {"; for(j = 0; j < what.captures(i).size(); ++j) { if(j) std::cout << ", "; else std::cout << " "; std::cout << "\"" << what.captures(i)[j] << "\""; } std::cout << " }\n"; } } else { std::cout << "** No Match found **\n"; } } int main(int , char* []) { print_captures("(([[:lower:]]+)|([[:upper:]]+))+", "aBBcccDDDDDeeeeeeee"); print_captures("(.*)bar|(.*)bah", "abcbar"); print_captures("(.*)bar|(.*)bah", "abcbah"); print_captures("^(?:(\\w+)|(?>\\W+))*$", "now is the time for all good men to come to the aid of the party"); return 0; } Which produces the following output: Expression: "(([[:lower:]]+)|([[:upper:]]+))+" Text: "aBBcccDDDDDeeeeeeee" ** Match found ** Sub-Expressions: $0 = "aBBcccDDDDDeeeeeeee" $1 = "eeeeeeee" $2 = "eeeeeeee" $3 = "DDDDD" Captures: $0 = { "aBBcccDDDDDeeeeeeee" } $1 = { "a", "BB", "ccc", "DDDDD", "eeeeeeee" } $2 = { "a", "ccc", "eeeeeeee" } $3 = { "BB", "DDDDD" } Expression: "(.*)bar|(.*)bah" Text: "abcbar" ** Match found ** Sub-Expressions: $0 = "abcbar" $1 = "abc" $2 = "" Captures: $0 = { "abcbar" } $1 = { "abc" } $2 = { } Expression: "(.*)bar|(.*)bah" Text: "abcbah" ** Match found ** Sub-Expressions: $0 = "abcbah" $1 = "" $2 = "abc" Captures: $0 = { "abcbah" } $1 = { } $2 = { "abc" } Expression: "^(?:(\w+)|(?>\W+))*$" Text: "now is the time for all good men to come to the aid of the party" ** Match found ** Sub-Expressions: $0 = "now is the time for all good men to come to the aid of the party" $1 = "party" Captures: $0 = { "now is the time for all good men to come to the aid of the party" } $1 = { "now", "is", "the", "time", "for", "all", "good", "men", "to", "come", "to", "the", "aid", "of", "the", "party" } Unfortunately enabling this feature has an impact on performance (even if you don't use it), and a much bigger impact if you do use it, therefore to use this feature you need to: * Define BOOST_REGEX_MATCH_EXTRA for all translation units including the library source (the best way to do this is to uncomment this define in boost/regex/user.hpp and then rebuild everything. * Pass the match_extra flag to the particular algorithms where you actually need the captures information (regex_search, regex_match, or regex_iterator). from: http://www.boost.org/libs/regex/doc/captures.html
  13. I think you're on the right track, this seems to be related to how boost regex works (this may be universal, i'm not sure). But as far as i can tell the part intended to match the attributes IS matching all the attributes, but it's only keeping the last match. If you're familiar with other regex flavors, you'll know that you can do "backreferences" by either $n or \n where n is an integer generall 1-number_of_parenthesis so in, say, sed. \0 matches the entire string passed \1 would match the first match (the first parenthesis starting from left to right (ie element) \2 would match the second parenthesis, from left to right \3 etc \4 etc I guess what i'm trying to get at here is there's no support/recognition of repetition, so it appears the behavior is just to keep the last match (subsequent matches overwrite previous ones) One answer might be to "advance" through the string, from one match to the next by hand, though i suspect there may be a better way (i'd hope so).
  14. Hah, reading someone else's regex is like gouging your eyes out with a spoon, I'll take a crack at it though.
  15. I know they support(ed?) linux to a small degree for a while, but it might have just been the physics API rather than the hardware support. (Plus I remember for sure that there was a hefty fee involved with getting the SDK for linux... wtf?)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!