游戏开发论坛

 找回密码
 立即注册
搜索
楼主: lights

.net 图形引擎 LL3D正式出炉

[复制链接]

140

主题

1228

帖子

1233

积分

金牌会员

Rank: 6Rank: 6

积分
1233
QQ
 楼主| 发表于 2005-12-15 12:44:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

说句打击各位的话,上述vb.net可实现要很久。custom UI最典型,是非托管混合的,用的是普通窗口,和vb.net有不兼容的地方。所以根本不能算托管UI。而且不是新版sdk才有的。

1

主题

23

帖子

40

积分

注册会员

Rank: 2

积分
40
发表于 2005-12-15 12:56:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

楼主的...页面打不开

89

主题

822

帖子

847

积分

高级会员

Rank: 4

积分
847
发表于 2005-12-15 16:33:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

早期的例子中C#中含有非托管代码,估计微软写那个例子的人还是舍不得VC,哈哈,新版本没有了。

还有关于窗口都是从框架类Form派生出来的,没有什么普通窗口非普通窗口之分。

大家将就着看吧,学习学习思想和方法就可以了,里面不完善还是有的,毕竟只是个例子。效果还是不错的,推荐推荐。

反正源代码就在那放着,大家爱怎么改就怎么改,有心得交流交流

140

主题

1228

帖子

1233

积分

金牌会员

Rank: 6Rank: 6

积分
1233
QQ
 楼主| 发表于 2005-12-15 17:17:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

那个窗口根本不是框架的,是api CreateWindow出来的,我的LL3D刚换了新网站
http:\\Trinity.gameres.com

89

主题

822

帖子

847

积分

高级会员

Rank: 4

积分
847
发表于 2005-12-15 17:29:00 | 显示全部楼层

Re: .net 图形引擎 LL3D正式出炉

呵呵,CreateWindow是他自己写的函数


       /// <summary>
        /// Creates a window with the specified title, icon, menu, and starting position.  If Init hasn't been
        /// called, this will call with default params.  Instead of calling this, you can call SetWindow
        /// to use an existing window
        /// </summary>
        public void CreateWindow(string windowTitle, System.Drawing.Icon icon,
            System.Windows.Forms.MainMenu menu, int x, int y)
        {
            if (State.IsInsideDeviceCallback)
                throw new InvalidOperationException("You cannot create a window from inside a callback.");

            State.WasWindowCreateCalled = true;
            // Are we inited?
            if (!State.IsInited)
            {
                // If Init was already called and failed, fail again
                if (State.WasInitCalled)
                {
                    throw new InvalidOperationException("Initialize was already called and failed.");
                }

                // Call initialize with default params
                Initialize(true, true, true);
            }

            // Is there already a window created?
            if (State.WindowFocus == null)
            {
                // Override the window's initial size and position if there were cmd line args
                if (State.OverrideStartX != -1)
                {
                    State.DefaultStartingLocation = System.Windows.Forms.FormStartPosition.Manual;
                    x = State.OverrideStartX;
                }
                if (State.OverrideStartY != -1)
                {
                    State.DefaultStartingLocation = System.Windows.Forms.FormStartPosition.Manual;
                    y = State.OverrideStartY;
                }

                // Create the new window
                GraphicsWindow renderWindow = new GraphicsWindow(this);
                // Hook the events
                HookEvents(renderWindow);
                // Are we in the default start location?
                if (State.DefaultStartingLocation == System.Windows.Forms.FormStartPosition.WindowsDefaultLocation)
                {
                    State.IsWindowCreatedWithDefaultPositions = true;
                    renderWindow.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation;
                }
                else
                {
                    State.IsWindowCreatedWithDefaultPositions = false;
                    renderWindow.Location = new System.Drawing.Point(x, y);
                }

                // Calculate the window size
                System.Drawing.Size windowSize = DefaultStartingSize;
                if (State.OverrideWidth != 0)
                    windowSize.Width = State.OverrideWidth;
                if (State.OverrideHeight != 0)
                    windowSize.Height = State.OverrideHeight;
                // Set the size
                renderWindow.ClientSize = windowSize;

                // Store the window title
                State.WindowTitle = windowTitle;
                renderWindow.Text = windowTitle;

                // Set current cursor
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;

                // Get the window's rectangles
                renderWindow.Visible = false;
                renderWindow.CreateControl();
                State.ClientRectangle = renderWindow.ClientRectangle;
                State.WindowBoundsRectangle = renderWindow.Bounds;

                // Update state
                State.WasWindowCreated = true;
                State.WindowFocus = renderWindow;
                State.WindowDeviceFullScreen = renderWindow;
                State.WindowDeviceWindowed = renderWindow;
            }
        }

        /// <summary>
        /// Calls into CreateWindow with default paramters
        /// </summary>
        public void CreateWindow(string windowTitle)
        {
            CreateWindow(windowTitle, LoadFirstIconFromResource(), null, -1, -1);
        }
        /// <summary>

89

主题

822

帖子

847

积分

高级会员

Rank: 4

积分
847
发表于 2005-12-15 17:33:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

GraphicsWindow renderWindow = new GraphicsWindow(this);

这句话才是关键


    #region Framework's Default Window
    /// <summary>
    /// The main window that will be used for the sample framework
    /// </summary>
    public class GraphicsWindow : System.Windows.Forms.Form
    {
        private Framework frame = null;
        public GraphicsWindow(Framework f)
        {
            frame = f;
            this.MinimumSize = Framework.MinWindowSize;
        }

        /// <summary>
        /// Will call into the sample framework's window proc
        /// </summary>
        protected override void WndProc(ref Message m)
        {
            frame.WindowsProcedure(ref m);
            base.WndProc (ref m);
        }


    }
    #endregion

140

主题

1228

帖子

1233

积分

金牌会员

Rank: 6Rank: 6

积分
1233
QQ
 楼主| 发表于 2005-12-15 17:41:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

咿?这个代码和我看到的不同,去看看2005 12的sdk再说。

89

主题

822

帖子

847

积分

高级会员

Rank: 4

积分
847
发表于 2005-12-15 17:48:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

好,大家都去下亚,300M,很快的,我ADSL每秒100多K,2个线程,不到一小时就下完了,里面有大量的文档和例子,有最新技术介绍,可以当教科书看了


http://download.microsoft.com/download/9/4/2/9428d199-bf6b-4bf4-8c45-89a439199278/dxsdk_dec2005.exe

140

主题

1228

帖子

1233

积分

金牌会员

Rank: 6Rank: 6

积分
1233
QQ
 楼主| 发表于 2005-12-15 17:57:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

其实和以前的版本没什么太大差异,我讨厌微软自说自话弄得dxut,非常感谢bigbook2000,纠正了我的错误,我已经记不清以前的代码是什么样了,但这个代码只是继承form,重写消息处理函数,vb.net可以直接做的,我会加一部分到LL3D里,但是那个输入法,没有实现标准的图形录入,光标也是错位的。我记得以前好像是有的,再去看老sdk。

26

主题

537

帖子

537

积分

高级会员

Rank: 4

积分
537
发表于 2005-12-16 09:41:00 | 显示全部楼层

Re:.net 图形引擎 LL3D正式出炉

请问bigbook2000提供的下载连接是哪个版本的DXSDK?对VB.Net在文档和示例上提供完全支持了吗?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-23 00:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表