• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

DevChrome/Pixel-Engine: A simple game engine for C# using OpenGL. Inspired by th ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

DevChrome/Pixel-Engine

开源软件地址:

https://github.com/DevChrome/Pixel-Engine

开源编程语言:

C# 88.0%

开源软件介绍:

Pixel-Engine

A simple game engine for C# using OpenGL (earlier DirectX). Inspired by the olcPixelGameEngine.

This game engine was ported from C++ to C# in the hopes that it will help people develop their ideas faster and not waste their time in creating the same graphics code and game loop again and again.

This engine uses OpenGL and the .NET Framework, so it's quite fast due to OpenGL being hardware accelerated.

Getting Started

  1. Grab the library from the Libraries folder.
  2. Create a new C# project.
  3. Add a reference to the library in your project.
  4. Subclass the Game class in the engine.
  5. Add a Main method.
  6. Instantiate the class.
  7. Call its Construct method.
  8. Call its Start method.
  9. Override the required methods.
  10. Start the application.
using PixelEngine;

namespace Examples
{
	public class RandomPixels : Game
	{
		static void Main(string[] args)
		{
			// Create an instance
			RandomPixels rp = new RandomPixels();
      
      			// Construct the 100x100 game window with 5x5 pixels
			rp.Construct(100, 100, 5, 5); 
      
      			// Start and show a window
			rp.Start(); 
		}

		// Called once per frame
	  	public override void OnUpdate(float elapsed)
		{
			// Loop through all the pixels
			for (int i = 0; i < ScreenWidth; i++)
				for (int j = 0; j < ScreenHeight; j++)
					Draw(i, j, Pixel.Random()); // Draw a random pixel
		}
	}
}

Prerequisites

There are no additional dependencies outside the Windows Api, which is present in all windows installations, and some basic .Net Framework libraries which are present with all C# installations.

Examples

There are many examples present in the Examples folder, including Javidx9's and my own.

Deployment

Build your projects with this as a reference and run the generated .exe file.

Built With

Acknowledgments

Check out the olcPixelGameEngine for C++ and its creator, Javidx9, his website OneLoneCoder, and the OLC-3 License in the original project.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Critical-Hit/engine: Modular C++ game engine发布时间:2022-06-08
下一篇:
ross-g/io_pdx_mesh: Import/Export files for the Clausewitz game engine发布时间:2022-06-08
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap