Source code please

by Dimi 8. February 2010 17:27

Why do you visit forums? Ok the answer might depend on what you are interested in and on what you are looking for but let’s take me for example. I’m a software developer and when I visit a forum a try to exchange information with people who share the same interests and/or are involved in similar projects and/or try to find a solution for a specific problem. Now I noticed on many forums and blog posts that there are people who cannot evaluate their own skills. You often step over posts with the following title: “I’m new to game programming and I started developing my own game engine to produce a game like Doom3”.

Bump!

Bump!

Bump!

Ok there is nothing against a challenge but hey be serious. Do you really think you would be able to develop a first person shooter with latest features without ever drawn a single triangle on the screen? I usually avoid commenting such posts but here is one which made me go mad. On a forum a guy opened a new thread like the title above. He asked people to help him get started. One posted a link to beginner tutorials on OpenGL another posted beginner tutorials on DirectX, some other guys pointed him to a C++ reference and so on.

Now after some days this guy answered to all the comments that he doesn’t need tutorials but source code. Again people tried to help him with posting some code snippets on how to create a DirectX device or how to get started with OpenGL’s glut library. Now some days later I stepped over some blogs where I was looking for some tutorials myself. The same guy (I suppose it was the same since the username was the same and this username was so unique that it would hurt if someone else would use it) posted on a tutorial, which was fairly enhanced with explanations and pseudo-code, that he would need the source code for the example.

This was the point where I went mad. Why people think they could copy and paste tutorial code and build an game engine out of it. I like sites with source code very much but to help you learn a topic sites with pseudo-code are more than enough. You will never learn the essence of octree rendering if you copy and paste the source code of a tutorial into your own application. You should read carefully through the tutorial and work it out for yourself. I suppose only 5% of the tutorial codes are usable for your engine and a benefit is visible.

Think about it.

Tags: , ,

game development | development

IsNumeric in c#

by Dimi 23. October 2009 18:33

I’m currently working on a C# Windows forms application and was in need of a method which does the same as the good old Visual Basic method IsNumeric. Hahaha, sometimes the simplest things are hard to find. So I stepped over this Microsoft article: http://support.microsoft.com/kb/329488/de

What it does? It simply calls the method TryParse. The return value indicates whether it is numeric or not.

   1: static bool IsNumeric(object Expression)
   2: {
   3: // Variable to collect the Return value of the TryParse method.
   4:     bool isNum;
   5:  
   6: // Define variable to collect out parameter of the TryParse method. If the conversion fails, the out parameter is zero.
   7:     double retNum;
   8:             
   9: // The TryParse method converts a string in a specified style and culture-specific format to its double-precision floating point number equivalent.
  10: // The TryParse method does not generate an exception if the conversion fails. If the conversion passes, True is returned. If it does not, False is returned.
  11:     isNum = Double.TryParse(Convert.ToString(Expression), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum );
  12:     return isNum;
  13: }        

Seems that this post would fit better in facebook ;)

Tags: , ,

development

FileSpy and other sins….

by Dimi 2. February 2009 16:32

I tried to clean up the mess a bit, so I decided to close my old site www.g-productions.net. All the downloads especially the DevPaks and stuff where taken over to this site. While doin the cleanup I found this little prog which I had have programmed with Visual Basic 6.0. That times I thought it would be important having a prog like this. What it does? It lists all the files of a specified drive and/or directory.

If I remember I developed this application because I had to clean up some machines and needed a list of files for something.

Nevertheless here you are with FileSpy ;)

filespy_setup.exe (1,53 mb)

Tags: ,

development

PrinterDLL or how to make Lotus Notes to print in landscape

by Dimi 26. June 2004 12:34

About the PrinterDLL
The PrinterDLL was an experiment at the company I work for, to enable Lotus Notes to print in landscape format. Since there were a couple of suggestions nobody had solved the problem. After a bit of research we figured out that this would get more difficult than expected.


The Microsoft way
The only usable solution at current is a Visual Basic dll example from Microsoft. This dll provides a class that reads the current printer settings and changes the property for the printer orientation. Since this dll is a good example for designing the class, it won't work on W2k or WinXP without administrative privileges.


The G-Productions way
I took the Microsoft idea as base and designed my own class, and it worked on different operating systems. So I posted at the forum on www.notes.net my solution and after a few days I received lots of emails asking me for a copy. So I put the dll for download at http://home.arcor.de/g-productions site and it seemed the problem was solved. Then people began to mail me about problems with the privileges stuff. There was no possibility to test it on the specified machines (in most cases WinXP was the problem) so other people were on to help me. I thought of continue developing on it....


Current status
The current version of the PrinterDLL is v0.9.5 beta, this means, that it works fine as people reported but has no error handling. This is something more serious because of the different OS you use. Another serious problem is, that it may freeze your system when trying to access more than one instance of the main class provided in the library.


Documentation
There should be something like a user guide, but there isn't. I will give you in the following a short instruction on how to use this library.


The dll contains 4 functions:
Function GetDefaultPrinterName() as String
This function returns a string containing the name of the default printer installed on the system.
Function SetOrientation(ByVal mOrientation As Integer, ByVal mType as Integer) as Boolean
This function is the important one. It sets the printer orientation to the desired value and returns a boolean for success or failure. The parameters are as following:

  • mOrientation should be an integer value between 1-3 where the value selects the technique to use when changing the orientation.
  • 1 selects the Visual Basic Printer Object (if you will use the dll for Lotus Notes, selecting this value is maybe a bad option)
  • 2 selects API calls. (if you will use the dll for LotusNotes this option is best)
  • 3 selects driver control. NOTE: This option is still experimental. You can harm your system if you use this option.
  • mType should be an integer value between 1-2. This value sets the desired orientation where
  • 1 changes the orientation to portrait (in most cases this is the default value)
  • 2 changes the orientation to landscape.
  • The function returns false if the desired function failed or true for successfully changing the value.
Function ReSetOrientation() as Boolean
When the printerdll is called to change a print orientation the dll stores the old orientation in order to be able to reset the orientation to the desired value. To reset the orientation to the default value you have to manually call this function. It returns true for success or false for failure.
Function GetOrientation() as Integer
This function returns an Integer value for the current printer orientation. 1 for portrait, 2 for landscape and 0 for not determined.
Function GetPrinterList() as Variant
This function returns an array with the systemwide installed printers.

pcontrol_setup.exe (1,09 mb)

Tags: , ,

development

Powered by BlogEngine.NET 1.6.0.0
Theme adopted by Dimi with portions of Mads Kristensen and portions of Rtur.net

RecentPosts