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

[Official] Eclipse.NET


JeffSventora
 Share

Recommended Posts

  • Replies 337
  • Created
  • Last Reply

Top Posters In This Topic

We'll be sticking to C#. There are plenty of resources available on the web that let you convert C# code to Vb.NET code. By all means, if you want to do it, do it.

And features such as particles and what not aren't for showing off and competing, its simply to add more elements to every game made with it to help create a more polished and professional quality game. In fact, a lot of the features adding are only considered "fancy" to very few. Most of them are standards in most games.

Just a little update, I know things have been slow but I have until the 26th to finish developing a certain app so it's had my devotion. Do not worry though, I have some pretty cool things coming soon ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

> Or you could let a C# engine be a C# engine.

Seemed like Jeff had the language as being open for discussion; a few pages back, it was mentioned that the community would "vote" on whether or not to continue the project in C++. A few people mentioned that the target market segment for this type of thing is 12-18 year olds, and that developers need to keep in mind that simple is necessarily better in terms of that context; I simply added that it's easier to migrate from VB6 to VB.NET instead of learning an entirely new syntax from square one.
Link to comment
Share on other sites

Well even VB.NET wouldn't be completely easy either. Most people with very limited programming knowledge of VB6, 90% of the time think they can open up Eclipse in VS 2002 or higher and have a working version of Eclipse in .NET. While the syntax is similar in many cases, a lot of things changed. And regardless of what one prefers, the biggest advantage of C# in my opinion is typing less words! Believe me, people who were able to pick up VB6 will have no problem interpreting my code in C#.
Link to comment
Share on other sites

  • 3 weeks later...
fantastic progress this engine in C # I hope to soon have a test version

although C # is a otima linguagen I prefer vb.net,the similarity with vb6

these days I even decided to continue the project EO.Net

![](http://www.freemmorpgmaker.com/files/imagehost/pics/abe869684b6f1bc363b28f45545514b8.png)

changelog

> - Issues Resolved
>
> - Movement of CHARACTERS
>
> - Movement npc
>
> - Upload and password login menu
>
> - Close server normally
>
> - Reorganization of file folder and dlls
>
> - New sound system
>
> - Redone loop system client and server
>
> - Redone array system packs client and server
>
> - Redone systems editors: map, npc, animation, magic, shop items.
>
> - login system
>
> - Redone connection system
>
> - gdi
>
> - Redone system rendering fps Customer
>
> - Input system redone Customer
>
> - unresolved problems
>
> - GDI change for DX9

sorry for my english
Link to comment
Share on other sites

> Things have been slow but I'm working on something unbelievably cool. Something that will excite pro's and noobs alike. Stay tuned folks.

Oh Jeff you tease..

And Bud, I think it's XNA, but I'm probably wrong. ![:rolleyes:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/rolleyes.gif)
Link to comment
Share on other sites

Well as you guys know, I was using XNA as the preferred graphics API. I asked you all about your thoughts on the differences between C# & C++. I took everything into consideration and I've spent some time figuring out how to gain the best of both worlds. With that being said, I'll give you guys only this bit of information: I will NOT be using XNA to render to the screen however, I will be using XNA for input and Audio. The engines graphics will be run under the hood using DirectX 9\. I'm in the process of writing a DLL for the engines renderer as we speak. This will allow the gurus to hop into the C++ and optimize the renderer but still give the noobs the higher level of access to the functions in C#. I'll post more information soon.
Link to comment
Share on other sites

Okay guys, here is a little more info on the latest big update. The graphics engine is just about done. I also wanted to re-brand the solution. While the client & server are named just "Client" & "Server", what was known as FusionLIB is now known as **Umbra** and the new rendering engine made in C++ is known as **Solar**. I like breaking things up appropriately. So, let's jump in shall we?

![](http://www.freemmorpgmaker.com/files/imagehost/pics/b3e39b53662c520c8879111d3d9229f0.jpg)

As you can see everything is fully working. here is what's featured on the C++ side:

- Alpha Blending

- Scalable, Rotatable Sprites

- Window Resizing

- Texture Management

Let's look at the code (Solar):

```

#ifndef _RENDERER_H

#define _RENDERER_H

#include "Include.h"

#define DECL __declspec(dllexport)

#define STD __stdcall

extern "C"

{

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: Initialize

// PURPOSE: Initializes D3D objects for use in rendering.

// RETURNS: Return s a bool determining the success of initialization

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: HWND _intPtrHandle - Handle to the surface being rendered to

// IN: int _bufferWidth - Width of the back buffer surface

// IN: int _bufferHeight - Height of the back buffer surface

///////////////////////////////////////////////////////////////////////////////////

DECL bool STD Initialize(HWND _intPtrHandle, int _bufferWidth, int _bufferHeight);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: Clear

// PURPOSE: Clears the back buffer tothe specified color.

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: int r - Red component of the clear color

// IN: int g - Green component of the clear color

// IN: int b - Blue component of the clear color

///////////////////////////////////////////////////////////////////////////////////

DECL void STD Clear(int r, int g, int ![B)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/cool.png);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: Begin

// PURPOSE: Prepares the D3D Device for rendering

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

///////////////////////////////////////////////////////////////////////////////////

DECL void STD Begin(void);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: End

// PURPOSE: Ends the device rendering phase

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

///////////////////////////////////////////////////////////////////////////////////

DECL void STD End(void);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: Present

// PURPOSE: Displays rendered components to the back buffer

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

///////////////////////////////////////////////////////////////////////////////////

DECL void STD Present(void);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: ShutDown

// PURPOSE: Releases any D3D objects being used

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

///////////////////////////////////////////////////////////////////////////////////

DECL void STD ShutDown(void);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: onresize

// PURPOSE: Fixes any display issues upon resizing of the back buffer

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: int _bufferWidth - New width of the back buffer surface

// IN: int _bufferHeight - New height of the back buffer surface

///////////////////////////////////////////////////////////////////////////////////

DECL void STD onresize(int _bufferWidth, int _bufferHeight);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: LoadTexture

// PURPOSE: Fixes any display issues upon resizing of the back buffer

// RETURNS: Integer defining index into the array of textures, vital!

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: const TCHAR* _szFile - texture file to open.

///////////////////////////////////////////////////////////////////////////////////

DECL int STD LoadTexture(const TCHAR* _szFile);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: UnoadTexture

// PURPOSE: Releases any resources used by specified texture.

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: int _nIndex - texture file to open.

///////////////////////////////////////////////////////////////////////////////////

DECL void STD UnloadTexture(int _nIndex);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: Draw

// PURPOSE: Draws given texture.

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: int _nIndex - texture file to draw.

// IN: float _fX - x position to draw texture

// IN: float _fY - y position to draw texture

// IN: float _fScaleX - x scale factor to draw texture

// IN: float _fScaleY - y scale factor to draw texture

// IN: float _fRotX - x rotation factor to draw texture

// IN: float _fRotY - y rotation factor to draw texture

// IN: float _fRot - rotation factor to draw texture

// IN: int _nA - Alpha color component

// IN: int _nR - R color component

// IN: int _nG - G color component

// IN: int _nB - B color component

///////////////////////////////////////////////////////////////////////////////////

DECL void STD Draw(int _nIndex, float _fX, float _fY, float _fScaleX, float _fScaleY, float _fRotX, float _fRotY, float _fRot, int _nA, int _nR, int _nG, int _nB);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: TextureWidth

// PURPOSE: Allows user to get the width of the specified texture

// RETURNS: Integer with the width

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: int _nIndex - index of the texture to access

///////////////////////////////////////////////////////////////////////////////////

DECL int STD TextureWidth(int _nIndex);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: TextureHeight

// PURPOSE: Allows user to get the Height of the specified texture

// RETURNS: Integer with the height

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: int _nIndex - index of the texture to access

///////////////////////////////////////////////////////////////////////////////////

DECL int STD TextureHeight(int _nIndex);

///////////////////////////////////////////////////////////////////////////////////

// FUNCTION: Resizing

// PURPOSE: Needed so the renderer knows when the window is resizing

// RETURNS: VOID

// PARAMATERS

// -------------------------------------------------------------------------------

// IN: bool _bResizing - bool to tell whether or not we are resizing.

///////////////////////////////////////////////////////////////////////////////////

DECL void STD Resizing(bool _bResizing);

}

#endif

```

```

#include "Renderer.h"

#include "Texture2D.h"

#include using std::vector;

// Data Members

D3DPRESENT_PARAMETERS g_presentParams;

IDirect3D9* g_d3dObj = NULL;

IDirect3DDevice9* g_d3dDevice = NULL;

ID3DXLine* g_d3dLine = NULL;

ID3DXSprite* g_d3dSprite = NULL;

std::vector g_Textures;

bool g_Resizing;

typedef vector::size_type SIZET;

extern "C"

{

DECL bool STD Initialize(HWND _IntPtrHandle, int _bufferWidth, int _bufferHeight)

{

g_d3dObj = Direct3DCreate9(D3D_SDK_VERSION);

if(!g_d3dObj)

return false;

ZeroMemory(&g_presentParams, sizeof(D3DPRESENT_PARAMETERS));

g_presentParams.BackBufferWidth = _bufferWidth;

g_presentParams.BackBufferHeight = _bufferHeight;

g_presentParams.BackBufferFormat = D3DFMT_UNKNOWN;

g_presentParams.BackBufferCount = 1;

g_presentParams.MultiSampleType = D3DMULTISAMPLE_NONE;

g_presentParams.MultiSampleQuality = 0;

g_presentParams.SwapEffect = D3DSWAPEFFECT_COPY;

g_presentParams.hDeviceWindow = _IntPtrHandle;

g_presentParams.Windowed = true;

g_presentParams.EnableAutoDepthStencil = false;

g_presentParams.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;

g_presentParams.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;

g_presentParams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

if(FAILED(g_d3dObj->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, _IntPtrHandle, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_presentParams, &g_d3dDevice)))

return false;

if(FAILED(D3DXCreateLine(g_d3dDevice, &g_d3dLine)))

return false;

if(FAILED(D3DXCreateSprite(g_d3dDevice, &g_d3dSprite)))

return false;

return true;

}

DECL void STD Clear(int r, int g, int ![B)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/cool.png)

{

if(!g_Resizing)

g_d3dDevice->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255, r, g, ![B)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/cool.png), 1.0f, 0);

}

DECL void STD Begin(void)

{

if(!g_Resizing)

if(!FAILED(g_d3dDevice->BeginScene()))

if(!FAILED(g_d3dLine->Begin()))

g_d3dSprite->Begin(D3DXSPRITE_ALPHABLEND);

}

DECL void STD End(void)

{

if(!g_Resizing)

if(!FAILED(g_d3dSprite->End()))

if(!FAILED(g_d3dLine->End()))

g_d3dDevice->EndScene();

}

DECL void STD Present(void)

{

if(!g_Resizing)

g_d3dDevice->Present(0, 0, 0, 0);

}

DECL void STD ShutDown(void)

{

if(g_d3dSprite)

g_d3dSprite->Release();

if(g_d3dLine)

g_d3dLine->Release();

if(g_d3dDevice)

g_d3dDevice->Release();

if(g_d3dObj)

g_d3dObj->Release();

}

DECL void STD onresize(int _bufferWidth, int _bufferHeight)

{

g_presentParams.BackBufferWidth = _bufferWidth;

g_presentParams.BackBufferHeight = _bufferHeight;

g_d3dLine->OnLostDevice();

g_d3dSprite->OnLostDevice();

g_d3dDevice->Reset(&g_presentParams);

g_d3dLine->onresetDevice();

g_d3dSprite->onresetDevice();

}

DECL int STD LoadTexture(const TCHAR* _szFile)

{

if(!_szFile)

return -1;

vector::iterator i;

int index = 0;

for(i = g_Textures.begin(); i != g_Textures.end(); ++i)

{

if(!_tccmp(_szFile, (*i)->FileName()))

{

(*i)->AddRef();

return index;

}

++index;

}

index = -1;

for(int j = 0; (SIZET)j < g_Textures.size(); ++j)

{

if(!g_Textures[j])

{

index = j;

break;

}

}

if(index < 0)

{

Texture2D* temp = new Texture2D();

temp->SetFileName(_szFile);

HRESULT res = D3DXCreateTextureFromFile(g_d3dDevice, _szFile, temp->Texture());

if(FAILED(res))

return -1;

temp->AddRef();

D3DSURFACE_DESC desc;

ZeroMemory(&desc, sizeof(desc));

(*temp->Texture())->GetLevelDesc(0, &desc);

temp->SetWidth(desc.Width);

temp->SetHeight(desc.Height);

g_Textures.push_back(temp);

return (int)g_Textures.size() - 1;

}

else

{

g_Textures[index] = new Texture2D();

Texture2D* temp = g_Textures[index];

temp->SetFileName(_szFile);

HRESULT res = D3DXCreateTextureFromFile(g_d3dDevice, _szFile, temp->Texture());

if(FAILED(res))

return -1;

temp->AddRef();

D3DSURFACE_DESC desc;

ZeroMemory(&desc, sizeof(desc));

(*temp->Texture())->GetLevelDesc(0, &desc);

temp->SetWidth(desc.Width);

temp->SetHeight(desc.Height);

return index;

}

}

DECL void STD UnloadTexture(int _nIndex)

{

if(_nIndex < -1 || (SIZET)_nIndex >= g_Textures.size())

return;

g_Textures[_nIndex]->Release();

if(g_Textures[_nIndex]->RefCount() <= 0)

delete g_Textures[_nIndex];

}

DECL void STD Draw(int _nIndex, float _fX, float _fY, float _fScaleX, float _fScaleY, float _fRotX, float _fRotY, float _fRot, int _nA, int _nR, int _nG, int _nB)

{

if(_nIndex > -1 && (SIZET)_nIndex < g_Textures.size())

{

Texture2D* tex = g_Textures[_nIndex];

if(tex)

{

D3DXMATRIX scale;

D3DXMATRIX rotation;

D3DXMATRIX translate;

D3DXMATRIX final;

D3DXMatrixIdentity(&final);

D3DXMatrixScaling(&scale, _fScaleX, _fScaleY, 1.0f);

final *= scale;

D3DXMatrixTranslation(&translate, -_fRotX * _fScaleX, -_fRotY * _fScaleY, 0.0f);

final *= translate;

D3DXMatrixRotationZ(&rotation, _fRot);

final *= rotation;

D3DXMatrixTranslation(&translate, _fRotX * _fScaleX, _fRotY * _fScaleY, 0.0f);

final *= translate;

D3DXMatrixTranslation(&translate, _fX, _fY, 0.0f);;

final *= translate;

g_d3dSprite->SetTransform(&final);

g_d3dSprite->Draw(*tex->Texture(), nullptr, NULL, NULL, D3DCOLOR_ARGB(_nA, _nR, _nG, _nB));

D3DXMatrixIdentity(&final);

g_d3dSprite->SetTransform(&final);

}

}

}

DECL int STD TextureWidth(int _nIndex)

{

if(_nIndex > -1 && (SIZET)_nIndex < g_Textures.size())

return (g_Textures[_nIndex]->Width());

return 0;

}

DECL int STD TextureHeight(int _nIndex)

{

if(_nIndex > -1 && (SIZET)_nIndex < g_Textures.size())

return (g_Textures[_nIndex]->Height());

return 0;

}

DECL void STD Resizing(bool _bResizing)

{

g_Resizing = _bResizing;

}

}

```

**IMPLEMENTATION** (Client)

```

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace Client

{

public partial class FrmMain : Form

{

// Data Members

int texture;

int texture2;

int texture3;

bool Resizing = false;

// Constructor

public FrmMain()

{

InitializeComponent();

}

// Methods

public void FireItUp()

{

texture = Solar.LoadTexture("1.png");

texture2 = Solar.LoadTexture("2.png");

texture3 = Solar.LoadTexture("1a.png");

}

public void Update(float delta, float total, float fps)

{

this.Text = "EclipseNET DX9 Build FPS: " + fps.ToString();

}

public void Render(float delta, float total, float fps)

{

Solar.Clear(Color.CornflowerBlue.R, Color.CornflowerBlue.G, Color.CornflowerBlue.![B)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/cool.png);

Solar.Begin();

{

Solar.Draw(texture, 0f, 0f, 1f, 1f, 0f, 0f, 0f, 100, 255, 255, 255);

Solar.Draw(texture2, 512f, 0f, 1f, 1f, 0f, 0f, 0f, 255, 255, 255, 255);

Solar.DPI32_Draw(texture3, 0f, 512f, 1f, 1f, 0f, 0f, 0f, 150, 255, 255, 255);

}

Solar.End();

Solar.Present();

}

public void TurnItDown()

{

Solar.UnloadTexture(texture);

Solar.UnloadTexture(texture2);

Solar.UnloadTexture(texture3);

Solar.ShutDown();

}

// Back Buffer Resized

private void FrmMain_ResizeEnd(object sender, EventArgs e)

{

Solar.onresize(ClientSize.Width, ClientSize.Height);

Solar.Resizing(false);

}

private void FrmMain_ResizeBegin(object sender, EventArgs e)

{

// Raise flag

Solar.Resizing(true);

}

}

}

```
Link to comment
Share on other sites

> It's blended with the background. That is the alpha blend doing it's job. Basically, to sum it up, there is support for transparency. As far as the C++ talking to C# and vice versa, it's something called PInvoke.

Right.

With regards to C++/C#, would a user of the engine ever have to tinker with the C++ part of the code?
Link to comment
Share on other sites

It honestly seems like you're being extremely redundant with trying to rewrite XNA Content and Graphics. That's cool 'n all, but unless you can do it better and more efficiently than Microsoft, why bother, ya know? Or is this just one of those, "I'm doing it to say that I did it and because I want to." type of things? I'm not hating on ya whatsoever; I think it's awesome that you're re-inventing the wheel, per say, and implementing it in a way that is reusable (hopefully).
Link to comment
Share on other sites

I'm not reinventing anything, all I'm doing is giving the user more access to the lower level graphics API. It's all about control. On the surface In C#, it would be extremely simple to use and if you aren't comfortable with C++, you'll never have to worry. But what if someone wants to upgrade to DX11 or OpenGL? They could just go into the C++ source and modify the DLL and guess what, in C# everything is still the same to them ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) It's like having a car and being able to swap out the engine, only people who know about cars will be able to tell the difference but a majority of people won't when they're behind the driver's seat.

> Right.
>
> With regards to C++/C#, would a user of the engine ever have to tinker with the C++ part of the code?

No, only if you are comfortable with doing so.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...