Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Godlord

Members
  • Posts

    5689
  • Joined

  • Last visited

    Never

Everything posted by Godlord

  1. Use [GetWindowLong](http://msdn.microsoft.com/en-us/library/windows/desktop/ms633584%28v=vs.85%29.aspx)([Ptr](http://msdn.microsoft.com/en-us/library/windows/desktop/ms633585%28v=vs.85%29.aspx)) and [SetWindowLong](http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591%28v=vs.85%29.aspx)([Ptr](http://msdn.microsoft.com/en-us/library/windows/desktop/ms644898%28v=vs.85%29.aspx)) to associate data with your window handle, allowing you access to that data within your event handler. The excessive use of global variables is usually seen as a [bad coding practice](http://c2.com/cgi/wiki?GlobalVariablesAreBad), and rightfully so. Context switches are _expensive_, especially when textures are involved. Therefore they should be avoided as much as is possible. Use [IDirect3D9_GetDeviceCaps](http://msdn.microsoft.com/en-us/library/windows/desktop/bb174320%28v=vs.85%29.aspx) to query the maximum texture size that is supported (D3DCAPS9.MaxTextureWidth and D3DCAPS9.MaxTextureHeight), and to query whether NPOT-textures are supported (albeit less interesting; D3DCAPS9.TextureCaps). Then create a texture of that size using [IDirect3DDevice9_CreateTexture](http://msdn.microsoft.com/en-us/library/windows/desktop/bb174363%28v=vs.85%29.aspx), and use [IDirect3DTexture9_LockRect](http://msdn.microsoft.com/en-us/library/windows/desktop/bb205913%28v=vs.85%29.aspx) to lock the texture, whereupon you can update (parts of) it by copying over the pixels directly (be aware of concepts such as pitch, pixel formats and so further, it is a lot more complicated than you might think it is), whereupon you have to unlock it using [IDirect3DTexture9_UnlockRect](http://msdn.microsoft.com/en-us/library/windows/desktop/bb205914%28v=vs.85%29.aspx). That way you can fill up your textures with tiles, and other images, until there is no space left, whereupon you can apply the same process for a new texture. This ensures you will have the least amount of textures, reducing the amount of context switches drastically. However, the process itself is quite difficult to implement, and I am not aware of any libraries that do the blitting and the entire management of such textures for you. What I am aware of is that the alternative provided by OpenGL is a lot easier to work with. People who have worked with OpenGL before may be familiar with [glTexSubImage2D](http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage2D.xml). Other than that, you should improve your organisation: split up logic into functions, name them properly, and group functions related to the same idea, task, etc. within the same file. Files shouldn't be longer than two to three hundred lines of code (with code generation being the major exception). Yours faithfully S.J.R. van Schaik.
  2. Godlord

    College

    BSc. Computer Science at the University of Amsterdam. Yours faithfully S.J.R. van Schaik.
  3. > When I made the comparison between Git GUI & Bash I was expecting us to take a step back and put ourselves inside the shoes of one of the many 12/13 year olds on the site. I understand completely why a command window would be better. I am not trying to argue why it's better or not. But I would mach rather hear the complaints from 3 people than to hear the complaints of many because they have no idea how transition from a server provided by Eclipse Origins to this one. While designing this program I am putting the consumer in mind, and the fact is that a majority of the consumers won't be Stephans lol. If you are keeping the consumer in mind, then why did you choose a user interface instead of a web service? Your kind of consumer would certainly fancy the latter. Yours faithfully S.J.R. van Schaik.
  4. > Cool:) > > Any language is allowed right? Yes, one is allowed to post about any language in this board, unless the thread concerns website development, considering there is a board for website development present. Yours faithfully S.J.R. van Schaik.
  5. > Thank! > > And the console is better, for some people at least. using the Form makes it easier to use. For example, run GIT Bash along side GIT GUI and you tell me which one look easier ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) lol > > Also, I forgot to mention, the scripts will support Visual Basic AND C#. > > Thanks MrMiguu, when you see the code you'll be baffled by the simplicity! ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) I don't even have a clue why that distinction is being made. Git is originally designed and developed to be used in a shell application such as Bash, which by the way, is a lot more extensive than Microsoft Command Prompt. For the Microsoft Windows version, they've decided to ship Bash with various UNIX utilities, as well as a Git GUI. In this case, it's simply better to use the Bash version because it is the most _consistent_. Other platforms simply won't have the Git GUI application, because it has been developed for Microsoft Windows, specifically. For Microsoft Windows I can understand why you would want a GUI, rather than the command line. The major reason being that Microsoft hasn't been able to design a proper command line utility for the past twenty to thirty years. For most other platforms, a command line really is the better solution in most cases, and here's why that is: a command line only requires you to know the name of the programme(s) you want to use, as well as the arguments you want to pass to them, a GUI requires you to orientate, locate and select. The comparison is rather simplistic in that case: a command line requires a keyboard, that's about it, a GUI requires you to use a mouse, most of the times, unless you know the exact accelerators (and for some applications these are completely inconsistent). The use of the mouse has several issues, the first being the one I've pointed out already: you have to orientate, locate and then select (usually numerous times before you get your action completed). The second being that a mouse is much more likely to cause RSI (One of my teachers is not allowed to use a mouse at all, and only uses it when it is required. She uses the keyboard for pretty much everything). Finally, most people are more likely to use the keyboard for most of their actions, simply because you don't have to move it. > It doesn't really hinder performance because I have the UI and the Networking operating on their own threads. But I see where you're coming from. The big thing is that I want it to be as user-friendly as possible. You could EASILY take the existing code and convert it to use a console if you pleased. This is not how servers are being developed most of the times. Servers are usually written as a service application (Microsoft Windows) or as a daemon application (UNIX et al.), where they can be accessed via the (local) network using command line and/or GUI utilities. Furthermore, it could be accessed via a website, if you really feel like doing that. It may be a good idea to design your server in such a fashion. There are numerous reasons for using one of the aforementioned models. The first being that most people tend to use a separate computer, solely for the purpose of acting as a server. In which case, you are pretty much enforcing them to hook up a monitor to their server, whenever they have to administer the server, and you are pretty much enforcing them to run a desktop environment. On Microsoft Windows, the latter isn't as much of an issue, since, like I've said earlier, Microsoft hasn't been able to design a proper command line utility for the past twenty to thirty years. However, on about every UNIX system you are going to encounter, which is pretty much the de facto standard for servers, it is likely that you only have access to it through the use of a terminal (via a serial cable, via ssh, or, if you are fortunate, via an actual display hooked up to the server). A programme like X11, and anything that depends on it, is very unlikely to be installed, which means you won't have any form of graphics, other than an eighty by twenty-five grid of characters, and there are very good reasons to not have X11 installed. The first being one I've mentioned already: the graphical user-interface would be entirely inaccessible (X11 over the network is insecure and slow, and for Microsoft Windows there is nothing like X11, except for some applications that do offer remote access). Another reason is that just using a 1920x1080 display, will cost you about 15 MiB of RAM, just to generate and render any kind of simplistic screensaver. Then I am just ignoring all the other resources that would have been allocated. There is a whole lot more to it, than just having a few tests running on your desktop computer. Yours faithfully S.J.R. van Schaik.
  6. In case any of you want to see any tags added to this board, that haven't been added yet, then you can PM me or any other administrator. I think I should have added most common tags, though. Yours faithfully S.J.R. van Schaik.
  7. > I have a BizSpark account so I could easily obtain Microsoft Visual Studio. > > Is that also a compiler/IDE for Java? .. No, it only supports programming languages such as C++, C#.net, and Visual Basic.net. The two most popular choices amongst Java IDEs are Eclipse and NetBeans. Yours faithfully S.J.R. van Schaik.
  8. > very true, edited my post giving a few more options on how to compile it. You really shouldn't need Eclipse for this tutorial, but Eclipse is extremely helpful when you start creating your own code. Other IDEs are also good, Eclipse is just my favorite. The only IDE I actually do use is Microsoft Visual Studio, otherwise I simply favour a shell (at least, if you do have a proper build system such as make, CMake or Ant), a version control system (such as Git or Mercurial), and a text editor that offers syntax high-lighting, line numbering, proper indentaton and guide lines instead. Some people might as well, and some might prefer an IDE. Yours faithfully S.J.R. van Schaik.
  9. The only tools that are obligatory for this tutorial are the Sun/Oracle JRE (for run-time purposes) and the Sun/Oracle JDK (for development purposes). Yours faithfully S.J.R. van Schaik.
  10. Welcome to the board where programmers can ask each other questions, share their work and simply talk about anything related to programming. However, there is something to take into consideration before starting new threads. As some of you may have noticed, this board does support the use of tags to tell other members what programming language(s) is/are being involved in your thread. Even though they are not obligatory, it is encouraged to use them when possible, since this will inform other members, and possibly attract those who are experienced with the programming language(s) involved. Yours faithfully S.J.R. van Schaik.
  11. Godlord

    New Site

    If there appear to be any issues related to the member groups (e.g. the wrong permissions being set). Then one can send me a private message about it, and I'll look into it. Yours faithfully S.J.R. van Schaik.
  12. Godlord

    New Site

    > I can add different formatting options, I will see if I can add a VB6 code box. Like, [vb6][/vb6] > > Thanks, > > Aero/EBrown It would make more sense to have a language attribute or something similar for the code tag, if possible. Isn't there a plug-in that uses GeSHi? Yours faithfully S.J.R. van Schaik.
  13. Godlord

    New Site

    > That's what I thought, I just wanted to make sure they knew. I do wonder what the Default Language is, though. ``` #include int main(int argc, char *argv[]) { printf("Or is it C?\n"); return 0; } ``` ``` [SECTION .text] [GLOBAL _start] _start: mov eax, 4 mov ebx, 1 mov ecx, message mov edx, size int 0x80 mov eax, 1 int 0x80 [SECTION .data] message db 'It definitely doesn\'t attempt to detect the language, though.', 10 size equ $ - msg ``` Yours faithfully S.J.R. van Schaik.
  14. Godlord

    New Site

    > CodeBoxes don't display commented text correctly. > > ``` > 'If Difference > 4 Then > > Player(index).Vital(HP) = GetPlayerMaxVital(index, Vitals.HP) > > Player(index).Vital(MP) = GetPlayerMaxVital(index, Vitals.MP) > > Call SendVital(index, Vitals.HP) > > Call SendVital(index, Vitals.MP) > > Call PlayerMsg(index, "Your last login was " & Difference & " seconds ago. Vitals refilled.", Pink) > > End If > > '...And set the CSD login to the file for next use. > > Player(index).LastLogin = CSD > ``` > > As you can see, it comments everything between the ' instead of just the one line. It's high-lighting it as a string, since the default programming language for code tags simply isn't Visual Basic 6.0. Yours faithfully S.J.R. van Schaik.
  15. The best choice is the user's choice. If you are an experienced programmer, then you can query the resolutions that are supported. For DirectDraw you can do this by [enumerating](http://msdn.microsoft.com/en-us/library/windows/desktop/gg426138%28v=vs.85%29.aspx) the display modes, and [setting](http://msdn.microsoft.com/en-us/library/windows/desktop/gg426156%28v=vs.85%29.aspx) the one requested. For Direct3D you can do this by [enumerating](http://msdn.microsoft.com/en-us/library/windows/desktop/bb174314%28v=vs.85%29.aspx) the display modes, and by setting the window size to the requested display mode. You might want to look up information on how to use these functions in VB6. **Note**: some of these functions may not support all the display modes offered by the GPU. Yours faithfully S.J.R. van Schaik.
  16. I don't have a personal favourite, but I do have numerous games that have been released not so long ago that I find myself playing a lot, these are: | **Alan Wake** | | Alan Wake, the protagonist, of what is his own story, is a bestselling writer who favours writing psychological thrillers. Being affected by writer's block for the past few years, he decides to go on a holiday to a small, but fictional town named Bright Falls, Washington with his wife, where his wife vanishes mysteriously, which immediately sets the plot for his new book. The game tends to be interesting in the sense that Alan Wake is both the writer and the protagonist, with some very bizarre elements: such as having to find pages throughout the game, that he didn't seem to have written. One of the major elements in the game is that his wife suffers from achluophobia, which will become apparent at the start of the game. This has led to the introduction of some very interesting game mechanics, where you simply can't shoot your enemies, but where you have to use your torch as well to make them vulnerable to your shots. On top of that, well-lit places are considered safe zones. Personally, I think that Alan Wake is one of the most artistically engaging games, because of the way the story line is set up. However, I can imagine that this game may not be everyone's cup of tea, in which case watching any "Let's Play" without a commentator may be considered, since it is well worth it. | | **Orcs Must Die!** | | Orcs Must Die! and Orcs Must Die! 2 are pretty much tower-defence games, in the sense that you have to fend off orcs from reaching the Rift, which is basically a source of power. The plot itself is rather simplistic: as the wizard has been defending the Rift for several hundred years, his life finally comes to an end, leading to his apprentice having to protect the Rift instead. In the game you are given weapons, magical items, and traps that can be placed almost everywhere (although most of them are limited to either the floor, the walls or the ceiling). Orcs Must Die!, on the one hand, offers a simplistic upgrade system, where you can purchase single upgrades for your traps. In addition to that, you eventually get access to the Weavers (which allow you to purchase certain additional abilities for either your character or your traps during a map). Orcs Must Die! 2, on the other hand, being merely an improvement of Orcs Must Die!, offers a more complicated upgrade system instead, replacing the Weavers completely. In addition to that you also have access to vanity items and trinkets, the latter granting you passive and active abilities to use. I think Orcs Must Die! 2 is a great game to play with a friend, since one of the major changes has been the introduction of co-operative play, that was absent in Orcs Must Die! itself. Although, you can play Orcs Must Die! 2 with a friend, it's not obligatory. Orcs Must Die! 2 is as much as Orcs Must Die! a single player game. If you are in for some great fun, I really recommend this game. | | **PAYDAY: The Heist** | | PAYDAY: The Heist is a co-operative first-person shooter, where four criminals join up to rob banks, steal diamonds and other such criminal activities. I think this game has a lot of potential, and is great fun to play occasionally. However, there are a few issues with the game. The first being that there originally were six maps to play. With the L4D2 update, an additional map has been added to the game, and one can now purchase the DLC to add two new maps. This generally results into the fact that the game can get very repetitive after a while. Even though the maps are rather scarce, the level design makes every map unique, and interesting to play, and I personally feel that this is one of the great strenghts of the game. This brings me to the second issue, which is the fact, that most maps have two ways of playing them: the perfect one, and the tough one after screwing up. Some maps are incredibly hard to play in a perfect fashion, the most noticeable being the Diamond Heist map, which can end up being very frustrating, but it's usually very rewarding to do so, since the playthrough of the maps tends to be completely different. The problem being, that you usually need three to four players for all of the maps in order to even attempt to play them in a perfect fashion. On top of that, the game offers three skill trees (and an additional one if you buy the DLC) in which you can level up and unlock new weapons, and upgrades. Since the game is very difficult on its own, and even tends to be when you have a high reputation level, these are pretty much essential. I think that even though the game has a few issues, it's still a great game to play with your friends. | | **Trine** | | Trine and Trine 2 are side-scrolling action-based platform games involving numerous puzzles. The game is essentially a bed-time story about Zoya, the thief; Amadeus, the wizard; and Pontius, the knight, who have come in touch with an artifact named the Trine, known for its ability to bind souls. After being affected by the Trine, they, naturally, seek a way to undo its effect. One of the most interesting elements of this game is the fact that you can switch between the three characters, who all have their very own strenghts and weaknesses. Most of the puzzles, for instances, have several solutions, depending on the character you are using, and some areas are usually more easily accessed by the specific use of one of the characters. Even though Trine and Trine 2 are 2.5D games (3D scene, but 2D engagement), they are graphically astonishing, and they artisically fit the story well, as it tends to feel like an actual bed-time story. | | **Note** | | Your mileage may vary. | I might eventually end up adding some more games to this list, since I've only listed four games, thus far, of all the games I fancy playing. Yours faithfully S.J.R. van Schaik.
  17. One hundred and eighty-one. Yours faithfully S.J.R. van Schaik.
  18. One hundred and seventy-nine. Yours faithfully S.J.R. van Schaik.
  19. One hundred and seventy-seven. Yours faithfully S.J.R. van Schaik.
  20. One hundred and seventy-five. Yours faithfully S.J.R. van Schaik.
  21. One hundred and seventy-three. Yours faithfully S.J.R. van Schaik.
  22. One hundred and seventy-one. Yours faithfully S.J.R. van Schaik.
  23. One hundred and sixty-nine. Yours faithfully S.J.R. van Schaik.
  24. One hundred and sixty-seven. Yours faithfully S.J.R. van Schaik.
  25. One hundred and sixty-five. Yours faithfully S.J.R. van Schaik.
×
×
  • Create New...