Jump to content
  • Advertisement

LuckyOne

Member
  • Content count

    42
  • Joined

  • Last visited

Community Reputation

118 Neutral

About LuckyOne

  • Rank
    Member
  1. LuckyOne

    [.net] Saving Data in a C# app

    AFAIK DataSets involve files too (when saving data for further use), so basically there is no way to store any kind of data without writing them somewhere - registry, files, etc. Althoug there could be one solution - Try out something with System.Reflection. It provides access to Dynamic Code parsing e.t.c. I think its possible to code a program, that has an attached DataSet and a full program source, which compiles its self on the fly, then stays in memory and rewrites itself.. :P OK, this may sound unrealistic :) You might find this useful then
  2. LuckyOne

    [.net] .Net + MySQL, anyone?

    Most friendly solution as previously described would be: MySQL Connector / NET 1.0 - [Direct Download] Most generic would be: MySQL Connector/ODBC I have to admit that at first ADO.NET looks a bit confusing, though its very powerfull and contrary MySQL .NET Connector this is cross-platform. :) Ok, I might be wrong about .NET part possibly - they provide source code and it might compile under Mono too. Not really sure about that though. By the way there are many MySQL ADO.NET providers. This might interest you.
  3. LuckyOne

    [.net] Saving Data in a C# app

    Yeah, I usually use Settings - Pretty neat feature. Recently I started to use ini and xml files and this is exactly the library I was looking for, Thanks :)
  4. I have no problems with loading and rendering meshes, but its a complete nightmare when it comes to a level when i need to create one... My program keeps crashing when it all comes to this line. Well, i have no idea how to fix it and actually i will use this function once or twice in my life, so i dont actually need it so much IF i can get an alternative solution: Mesh mesh = new Mesh(256*256, 256*256, MeshFlags.Managed, CustomVertex.PositionColored.Format, fw.Device); What I need is a tool, which could convert 8 bit or better 16 bit RAW heightmap into DirectX Mesh (.X file). Problem Solved - Mister Max helped me out :) [Edited by - LuckyOne on October 17, 2006 12:02:39 PM]
  5. LuckyOne

    The Unofficial GameDev Music Project (v1.0)

    This is what i managed to create. Im too late, so its not for the contest, infact track is too short to be honored as song. Just tried to mess with the frog :D Frog in Trance
  6. I have pretty the same problem here. I have a base class "eventclass" which i need to access from "theOterClass", but with option to override its memebers in "Program" class. namespace Testing { class MyInterface { public virtual void OnSomethingIsDone(){ Console.WriteLine("OnSomethingIsDone()"); } } class MyClass : MyInterface { public static void Run() { while (true) { ... //Check every x secnd for new action if (action == "OnSomethingIsDone") xxxxxx???? //^- what shuould i do there, to access ovverrided method? } } } //Program itself class Program : MyInterface { static void Main(string[] args) { MyClass.Run(); } //i ovverride everything here public override void OnSomethingIsDone() { Console.WriteLine("aaaa"); To see if i can ovverride it correctly } } } Can someone help me?
  7. According to them you can easely achive this effect by using Thread.Sleep(xxx) after spceific amount of bytes have been received/sent. Here you can find Bandwidth Utilization monitor, which could help you to analyze your results...
  8. LuckyOne

    about radians

    Provided code will draw a triangle, with each vertex (point) colored in different color. //PositionColored means that there will be a color and position defined //for each vertex. There can be position only, colored & textured, e.t.c //We create 3 vertices vertices = new CustomVertex.PositionColored[3]; //Position in vector format - The first one vertices[0].Position = new Vector3(0f, 0f, 0f); //Color for the first vert vertices[0].Color = Color.Red.ToArgb(); //Position in vector format - The second one vertices[1].Position = new Vector3(10f, 0f, 0f); //Color for the second vert vertices[1].Color = Color.Green.ToArgb(); //Position in vector format - The third one vertices[2].Position = new Vector3(5f, 10f, 0f); //Color for the third vert vertices[2].Color = Color.Yellow.ToArgb(); Position is defined in a vector format. That is Vector3(x, y, z); coords For rotation we use Matrices in 3d space: device.Transform.World = Matrix.RotationZ(angle);
  9. The problem lies somewhere in your code. It looks like you have some nasty pointers there..
  10. LuckyOne

    about radians

    Radians are used for i.e. mesh rotation. If you are using C#, then this is just exactly you want to see
  11. Use StreamReader as Arild Fines mentioned, but if you have specific file format use RizMan's code. Actually both variation support unicode strings the only thing is the implementation.
  12. I use Ilut (OpenIL/DevIL) for image loading, its much more easier and cleaner. because i feel very good today i will share code i use in my projects: Supports loading of: * .bmp (tested) * .cut * .dcx * .dds * .ico * .gif * .jpg (tested) * .lbm * .lif * .mdl * .pcd * .pcx * .pic * .png (tested) * .pnm * .psd * .psp * .raw * .sgi * .tga * .tif * .wal * .act * .pal * .hdr * Doom graphics Containts internal Non-Power-of-two to power-of-two texture converter Very, very simple & intuitive usage Tao Library required http://www.mono-project.com/Tao /* I grant you all the rights to do whatever you want to do with this code. Free for all. Credit is not necessary. ;) */ using System; using System.Collections.Generic; using System.Text; using Tao.DevIl; using Tao.OpenGl; class ImageContainer { public int width = 0, height = 0, id = 0; public string title = null, filename = null; } class imageLoader { private static ImageContainer[] images; private static int count = 0; public void Initialize() { Il.ilInit(); Ilu.iluInit(); Ilut.ilutInit(); print("ImageLoader Initialized"); images = new ImageContainer[10000]; //maximum allowed images } private void print(string txt) { Console.WriteLine(txt); } public void Free() { //Free place for your code :) } public void LoadFromFile(string filename) { int tempID; if (!Il.ilLoadImage(filename)) { print("!Image: " + filename); return; } checkActiveImage(); //Generate ID Gl.glGenTextures(1, out tempID); Gl.glBindTexture(Gl.GL_TEXTURE_2D, tempID); Ilu.iluFlipImage(); Ilu.iluBuildMipmaps(); //Upload Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGB, Il.ilGetInteger(Il.IL_IMAGE_WIDTH), Il.ilGetInteger(Il.IL_IMAGE_HEIGHT), 0, Gl.GL_RGB, Gl.GL_UNSIGNED_BYTE, Il.ilGetData()); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR); Add(filename, ""); } public void LoadFromFile(string filename, string title) { int tempID; if (!Il.ilLoadImage(filename)) { print("!Image: " + filename); return; } checkActiveImage(); //Generate ID Gl.glGenTextures(1, out tempID); Gl.glBindTexture(Gl.GL_TEXTURE_2D, tempID); Ilu.iluFlipImage(); //Upload Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGB, Il.ilGetInteger(Il.IL_IMAGE_WIDTH), Il.ilGetInteger(Il.IL_IMAGE_HEIGHT), 0, Gl.GL_BGR, Gl.GL_UNSIGNED_BYTE, Il.ilGetData()); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_NEAREST); Add(filename, title); } //Get ID public int get(string title) { for (int i = 0; i < count; i++) { if (images.filename == title || images.title == title) { return images.id; } } return 0; } //Find Next Power of two dimensions public int nextPowerOfTwo(int n) { int i = 1; while (i < n) { i *= 2; } return i; } //Check if its power of two public bool powerOfTwo(int n) { return nextPowerOfTwo(n) == n; } //Check if picture need new dimensions private void checkActiveImage() { int width = Il.ilGetInteger(Il.IL_IMAGE_WIDTH); int height = Il.ilGetInteger(Il.IL_IMAGE_HEIGHT); if (width != height || (!powerOfTwo(width) || powerOfTwo(height))) { int newWidth = nextPowerOfTwo(width); int newHeight = nextPowerOfTwo(height); Ilu.iluScale(newWidth, newHeight, 3); width = newWidth; height = newHeight; Console.WriteLine("Image resized to:" + newWidth + " " + newHeight); } } private void Add(string filename, string title) { images[count] = new ImageContainer(); images[count].height = Il.ilGetInteger(Il.IL_IMAGE_HEIGHT); images[count].width = Il.ilGetInteger(Il.IL_IMAGE_WIDTH); images[count].filename = filename; images[count].title = title; images[count].id = count + 1; images[count + 1] = new ImageContainer(); count++; } } usage ... //Initialize imageLoader im = new imageLoader(); ... //Load im.LoadFromFile("test.bmp","sample texture"); im.LoadFromFile("logo.jpg"); ... //Use im.get("sample texture")); im.get("logo.jpg");
  13. LuckyOne

    Comparing & Finding changes

    Finally, Got it! Thanks, for the help! :D
  14. LuckyOne

    [.net] Wrapping MDX?

    No, its not limited to onpaint only, it actually depends on how you have designed your application. Its possible to use "while" drawing loop in console mode for example. In loop just do Application.DoEvents() and then then all the rest, including scene rendering
  15. Hi, on paper my problem is easy to fix, but in reality i have only little idea about how to do this. So this is what i have string olddata = "100,354,999,123,555"; string newdata = "100,200,123,234"; any ideas about how to find out which values are deleted and which are added? i expect to see something like this as result: string added = "200,234"; string removed = "354,999,555"; Any help would be appreciated :) p.s. im using c#
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!