首页 \ 问答 \ 没有UWP的DirectX 11/12可能吗?(DirectX 11/12 without UWP possible?)

没有UWP的DirectX 11/12可能吗?(DirectX 11/12 without UWP possible?)

自DX9时代以来,我一直没有看过DirectX。 是否可以制作DX11 / 12应用程序而无需使其成为UWP应用程序?

我有点担心UWP的开销 - 为了好玩,我做了一个空的应用程序,我注意到它只使用~30MB来绘制一个空白窗口。


I've haven't looked at DirectX since the DX9 era. Is it possible to make DX11/12 applications without having to also make them UWP applications?

I'm a little concerned about the overhead of UWP-- for fun, I made an empty application, and I noticed it uses ~30MB just to draw a blank window.


原文:
更新时间:2022-10-17 08:10

最满意答案

要通过XHR将JSON数据发送到Flask,我使用的方法是将Content-Type标题设置为"application/json" 。 然后,您可以从request.data对象中访问Flask。 我也清理了一些错字。

使用Javascript / HTML:

<script type="text/javascript">

    $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};

    $(function() {
        $('a#test_function').bind('click', function() {
            $.ajax({
                type: "POST",
                headers: {"Content-Type": "application/json"},
                url: $SCRIPT_ROOT + "/test",
                data: JSON.stringify({"key": "value"}),
                success: function(response) {
                    console.log(response);
                },
                error: function(response, error) {
                    console.log(response);
                    console.log(error);
                }
            });
        });
    });
</script>

<h1>jQuery Example</h1>
<a href="#" id="test_function">get string</a>

蟒蛇:

@app.route('/test', methods=['GET', 'POST'])
def test():
    vars = request.data
    return ', '.join([str(i) for i in vars])

To POST JSON data via XHR to Flask the method I use is to set the Content-Type heading to "application/json". Then you can access this within Flask from the request.data object. I cleaned up a couple typos as well.

Javascript/HTML:

<script type="text/javascript">

    $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};

    $(function() {
        $('a#test_function').bind('click', function() {
            $.ajax({
                type: "POST",
                headers: {"Content-Type": "application/json"},
                url: $SCRIPT_ROOT + "/test",
                data: JSON.stringify({"key": "value"}),
                success: function(response) {
                    console.log(response);
                },
                error: function(response, error) {
                    console.log(response);
                    console.log(error);
                }
            });
        });
    });
</script>

<h1>jQuery Example</h1>
<a href="#" id="test_function">get string</a>

Python:

@app.route('/test', methods=['GET', 'POST'])
def test():
    vars = request.data
    return ', '.join([str(i) for i in vars])

相关问答

更多
  • 将网址更改为您为表单设置的操作。 那将是: url = $form.attr('action'); $.ajax({ type : 'POST', url : url, data : formData, dataType: 'json', encode : true }) Change the url to the action you have set for the form. That would be: url = $form.attr('actio ...
  • 假设您发布的application.py脚本没有编辑,那么您将错过实际路由。 在请求基本URL(在您的情况下为http://54.68.62.180 )时,Flask根本不知道要提供什么,因此404.将以下内容添加到您的application.py文件中: @app.route('/') def hello_world(): return 'hello world!' 请参阅快速入门指南 。 Assuming the application.py script you posted is not ...
  • 我有同样的问题,不得不安装cordova-plugin-whitelist cordova plugin add cordova-plugin-whitelist 信用到这个stackoverflow文章 - Ajax命令要求URL不再工作 I had the same issue and had to install the cordova-plugin-whitelist cordova plugin add cordova-plugin-whitelist Credit goes to this ...
  • 终于找到了什么问题! 如果您确定路径没问题但是您遇到此错误,则IIS中的文件大小可能超过“允许的最大内容长度”。 在这种情况下,您将收到此错误“未找到网址”。 Finally find what is the problem! if you are sure the path is OK but you got this error, it is possible your file size is more than "Maximum allowed content length" in IIS. In ...
  • 我通过更改config.xml中的访问令牌来修复此问题: 从 ...至... I fixed this by changing the access token in the config.xml: From ...to...
  • 你会得到一个错误404,根据HTTP的意思是Not Found。 你可能在错误的路线上,没有映射到任何资源。 You are getting an error 404 which according to HTTP means Not Found. You probably on the wrong route which doesn't map to any resource.
  • 这是在与一些烧瓶应用程序一起使用后最适合我的骨架。 . ├── app │   ├── __init__.py │   └── t.py └── run.py 其中__init__.py : from flask import Flask app = Flask(__name__) from app import t t.py : from app import app @app.route('/') def index(): return 'hi!' 和run.py : from app ...
  • 感谢您发布您的web.xml 。 dispatcher *.* *.htm *.do 基于上面的配置,只有传入的URL有一些路径信息时,才会查询Spring的 ...
  • 要通过XHR将JSON数据发送到Flask,我使用的方法是将Content-Type标题设置为"application/json" 。 然后,您可以从request.data对象中访问Flask。 我也清理了一些错字。 使用Javascript / HTML: